Mercurial > hg > nginx-site
comparison xml/en/docs/http/ngx_http_proxy_module.xml @ 966:95c3c3bbf1ce
Text review.
author | Egor Nikitin <yegor.nikitin@gmail.com> |
---|---|
date | Wed, 14 Aug 2013 12:03:41 +0400 |
parents | fbb4cc6f8c3d |
children | e4704604ed29 |
comparison
equal
deleted
inserted
replaced
965:fadccc156188 | 966:95c3c3bbf1ce |
---|---|
46 <context>server</context> | 46 <context>server</context> |
47 <context>location</context> | 47 <context>location</context> |
48 <appeared-in>0.8.22</appeared-in> | 48 <appeared-in>0.8.22</appeared-in> |
49 | 49 |
50 <para> | 50 <para> |
51 Makes outgoing connections to a proxied server to originate | 51 Makes outgoing connections to a proxied server originate |
52 from the specified local IP <value>address</value>. | 52 from the specified local IP <value>address</value>. |
53 Value of the parameter can contain variables (1.3.12). | 53 Parameter value can contain variables (1.3.12). |
54 The special value <literal>off</literal> (1.3.12) cancels the effect | 54 The special value <literal>off</literal> (1.3.12) cancels the effect |
55 of the <literal>proxy_bind</literal> directive | 55 of the <literal>proxy_bind</literal> directive |
56 inherited from the previous configuration level, allowing the | 56 inherited from the previous configuration level, which allows the |
57 system to auto-assign the local IP address. | 57 system to auto-assign the local IP address. |
58 </para> | 58 </para> |
59 | 59 |
60 </directive> | 60 </directive> |
61 | 61 |
322 </example> | 322 </example> |
323 </para> | 323 </para> |
324 | 324 |
325 <para> | 325 <para> |
326 A cached response is first written to a temporary file, | 326 A cached response is first written to a temporary file, |
327 then the file is renamed. | 327 and then the file is renamed. |
328 Starting from version 0.8.9, temporary files and the cache can be put on | 328 Starting from version 0.8.9, temporary files and the cache can be put on |
329 different file systems, but be aware that in this case a file is copied | 329 different file systems. |
330 However, be aware that in this case a file is copied | |
330 across two file systems instead of the cheap renaming operation. | 331 across two file systems instead of the cheap renaming operation. |
331 It is thus recommended that for any given location both cache and a directory | 332 It is thus recommended that for any given location both cache and a directory |
332 holding temporary files, set by the <link id="proxy_temp_path"/> directive, | 333 holding temporary files, set by the <link id="proxy_temp_path"/> directive, |
333 are put on the same file system. | 334 are put on the same file system. |
334 </para> | 335 </para> |
384 <context>server</context> | 385 <context>server</context> |
385 <context>location</context> | 386 <context>location</context> |
386 | 387 |
387 <para> | 388 <para> |
388 Determines in which cases a stale cached response can be used | 389 Determines in which cases a stale cached response can be used |
389 when an error occurs in working with the proxied server. | 390 when an error occurs during communication with the proxied server. |
390 The directive’s parameters match the parameters of the | 391 The directive’s parameters match the parameters of the |
391 <link id="proxy_next_upstream"/> directive. | 392 <link id="proxy_next_upstream"/> directive. |
392 </para> | 393 </para> |
393 | 394 |
394 <para> | 395 <para> |
419 For example, the following directives | 420 For example, the following directives |
420 <example> | 421 <example> |
421 proxy_cache_valid 200 302 10m; | 422 proxy_cache_valid 200 302 10m; |
422 proxy_cache_valid 404 1m; | 423 proxy_cache_valid 404 1m; |
423 </example> | 424 </example> |
424 set 10 minutes of caching for responses with codes 200 and 302, | 425 set 10 minutes of caching for responses with codes 200 and 302 |
425 and 1 minute for responses with code 404. | 426 and 1 minute for responses with code 404. |
426 </para> | 427 </para> |
427 | 428 |
428 <para> | 429 <para> |
429 If only caching <value>time</value> is specified | 430 If only caching <value>time</value> is specified |
447 Parameters of caching can also be set directly | 448 Parameters of caching can also be set directly |
448 in the response header. | 449 in the response header. |
449 This has higher priority than setting of caching time using the directive. | 450 This has higher priority than setting of caching time using the directive. |
450 The <header>X-Accel-Expires</header> header field sets caching time of a | 451 The <header>X-Accel-Expires</header> header field sets caching time of a |
451 response in seconds. | 452 response in seconds. |
452 The 0 value disables caching for a response. | 453 The zero value disables caching for a response. |
453 If a value starts with the <literal>@</literal> prefix, it sets an absolute | 454 If a value starts with the <literal>@</literal> prefix, it sets an absolute |
454 time in seconds since Epoch, up to which the response may be cached. | 455 time in seconds since Epoch, up to which the response may be cached. |
455 If header does not include the <header>X-Accel-Expires</header> field, | 456 If header does not include the <header>X-Accel-Expires</header> field, |
456 parameters of caching may be set in the header fields | 457 parameters of caching may be set in the header fields |
457 <header>Expires</header> or <header>Cache-Control</header>. | 458 <header>Expires</header> or <header>Cache-Control</header>. |
773 <context>location</context> | 774 <context>location</context> |
774 | 775 |
775 <para> | 776 <para> |
776 Determines whether proxied responses with codes greater than or equal | 777 Determines whether proxied responses with codes greater than or equal |
777 to 300 should be passed to a client or be redirected to nginx for processing | 778 to 300 should be passed to a client or be redirected to nginx for processing |
778 by the <link doc="ngx_http_core_module.xml" id="error_page"/> directive. | 779 with the <link doc="ngx_http_core_module.xml" id="error_page"/> directive. |
779 </para> | 780 </para> |
780 | 781 |
781 </directive> | 782 </directive> |
782 | 783 |
783 | 784 |
790 | 791 |
791 <para> | 792 <para> |
792 When <link id="proxy_buffering">buffering</link> of responses from the proxied | 793 When <link id="proxy_buffering">buffering</link> of responses from the proxied |
793 server is enabled, and the whole response does not fit into the memory buffers | 794 server is enabled, and the whole response does not fit into the memory buffers |
794 set by the <link id="proxy_buffer_size"/> and <link id="proxy_buffers"/> | 795 set by the <link id="proxy_buffer_size"/> and <link id="proxy_buffers"/> |
795 directives, a part of a response can be saved to a temporary file. | 796 directives, a part of the response can be saved to a temporary file. |
796 This directive sets the maximum <value>size</value> of a temporary file. | 797 This directive sets the maximum <value>size</value> of a temporary file. |
797 The size of data written to a temporary file at a time is set | 798 The size of data written to a temporary file at a time is set |
798 by the <link id="proxy_temp_file_write_size"/> directive. | 799 by the <link id="proxy_temp_file_write_size"/> directive. |
799 </para> | 800 </para> |
800 | 801 |
1070 <context>server</context> | 1071 <context>server</context> |
1071 <context>location</context> | 1072 <context>location</context> |
1072 | 1073 |
1073 <para> | 1074 <para> |
1074 Defines a timeout for reading a response from the proxied server. | 1075 Defines a timeout for reading a response from the proxied server. |
1075 A timeout is only set between two successive read operations, | 1076 A timeout is set only between two successive read operations, |
1076 not for the transmission of the whole response. | 1077 not for the transmission of the whole response. |
1077 If a proxied server does not transmit anything within this time, | 1078 If a proxied server does not transmit anything within this time, |
1078 a connection is closed. | 1079 a connection is closed. |
1079 </para> | 1080 </para> |
1080 | 1081 |
1087 <context>http</context> | 1088 <context>http</context> |
1088 <context>server</context> | 1089 <context>server</context> |
1089 <context>location</context> | 1090 <context>location</context> |
1090 | 1091 |
1091 <para> | 1092 <para> |
1092 Allows disabling a passing of the original request body | 1093 Indicates whether the original request body is passed |
1093 to the proxied server. | 1094 to the proxied server. |
1094 <example> | 1095 <example> |
1095 location /x-accel-redirect-here/ { | 1096 location /x-accel-redirect-here/ { |
1096 proxy_method GET; | 1097 proxy_method GET; |
1097 proxy_pass_request_body off; | 1098 proxy_pass_request_body off; |
1113 <context>http</context> | 1114 <context>http</context> |
1114 <context>server</context> | 1115 <context>server</context> |
1115 <context>location</context> | 1116 <context>location</context> |
1116 | 1117 |
1117 <para> | 1118 <para> |
1118 Allows disabling a passing of the header fields of the original request | 1119 Indicates whether the header fields of the original request are passed |
1119 to the proxied server. | 1120 to the proxied server. |
1120 <example> | 1121 <example> |
1121 location /x-accel-redirect-here/ { | 1122 location /x-accel-redirect-here/ { |
1122 proxy_method GET; | 1123 proxy_method GET; |
1123 proxy_pass_request_headers off; | 1124 proxy_pass_request_headers off; |
1275 <context>server</context> | 1276 <context>server</context> |
1276 <context>location</context> | 1277 <context>location</context> |
1277 | 1278 |
1278 <para> | 1279 <para> |
1279 Sets a timeout for transmitting a request to the proxied server. | 1280 Sets a timeout for transmitting a request to the proxied server. |
1280 A timeout is only set between two successive write operations, | 1281 A timeout is set only between two successive write operations, |
1281 not for the transmission of the whole request. | 1282 not for the transmission of the whole request. |
1282 If a proxied server does not receive anything within this time, | 1283 If a proxied server does not receive anything within this time, |
1283 a connection is closed. | 1284 a connection is closed. |
1284 </para> | 1285 </para> |
1285 | 1286 |
1404 </para> | 1405 </para> |
1405 | 1406 |
1406 <para> | 1407 <para> |
1407 The modification time of files is set according to the received | 1408 The modification time of files is set according to the received |
1408 <header>Last-Modified</header> response header field. | 1409 <header>Last-Modified</header> response header field. |
1409 A response is first written to a temporary file, then a file is renamed. | 1410 A response is first written to a temporary file, and then the file is renamed. |
1410 Starting from version 0.8.9, temporary files and the persistent store | 1411 Starting from version 0.8.9, temporary files and the persistent store |
1411 can be put on different file systems, but be aware that in this case | 1412 can be put on different file systems. |
1412 a file is copied across two file systems instead of the cheap renaming | 1413 However, be aware that in this case a file is copied |
1413 operation. | 1414 across two file systems instead of the cheap renaming operation. |
1414 It is thus recommended that for any given location both saved files and a | 1415 It is thus recommended that for any given location both saved files and a |
1415 directory holding temporary files set by the <link id="proxy_temp_path"/> | 1416 directory holding temporary files, set by the <link id="proxy_temp_path"/> |
1416 directive are put on the same file system. | 1417 directive, are put on the same file system. |
1417 </para> | 1418 </para> |
1418 | 1419 |
1419 <para> | 1420 <para> |
1420 This directive can be used to create local copies of static unchangeable | 1421 This directive can be used to create local copies of static unchangeable |
1421 files, e.g.: | 1422 files, e.g.: |