Mercurial > hg > nginx-site
comparison xml/en/docs/http/ngx_http_fastcgi_module.xml @ 966:95c3c3bbf1ce
Text review.
author | Egor Nikitin <yegor.nikitin@gmail.com> |
---|---|
date | Wed, 14 Aug 2013 12:03:41 +0400 |
parents | ba3d6ade3513 |
children | c5ccf511346a |
comparison
equal
deleted
inserted
replaced
965:fadccc156188 | 966:95c3c3bbf1ce |
---|---|
13 rev="9"> | 13 rev="9"> |
14 | 14 |
15 <section id="summary"> | 15 <section id="summary"> |
16 | 16 |
17 <para> | 17 <para> |
18 The <literal>ngx_http_fastcgi_module</literal> module allows to pass | 18 The <literal>ngx_http_fastcgi_module</literal> module allows passing |
19 requests to a FastCGI server. | 19 requests to a FastCGI server. |
20 </para> | 20 </para> |
21 | 21 |
22 </section> | 22 </section> |
23 | 23 |
51 <context>server</context> | 51 <context>server</context> |
52 <context>location</context> | 52 <context>location</context> |
53 <appeared-in>0.8.22</appeared-in> | 53 <appeared-in>0.8.22</appeared-in> |
54 | 54 |
55 <para> | 55 <para> |
56 Forces outgoing connections to a FastCGI server to originate | 56 Makes outgoing connections to a FastCGI server originate |
57 from the specified local IP <value>address</value>. | 57 from the specified local IP <value>address</value>. |
58 Value of the parameter can contain variables (1.3.12). | 58 Parameter value can contain variables (1.3.12). |
59 The special value <literal>off</literal> (1.3.12) cancels the effect | 59 The special value <literal>off</literal> (1.3.12) cancels the effect |
60 of the <literal>fastcgi_bind</literal> directive | 60 of the <literal>fastcgi_bind</literal> directive |
61 inherited from the previous configuration level, allowing the | 61 inherited from the previous configuration level, which allows the |
62 system to auto-assign local address. | 62 system to auto-assign the local IP address. |
63 </para> | 63 </para> |
64 | 64 |
65 </directive> | 65 </directive> |
66 | 66 |
67 | 67 |
71 <context>http</context> | 71 <context>http</context> |
72 <context>server</context> | 72 <context>server</context> |
73 <context>location</context> | 73 <context>location</context> |
74 | 74 |
75 <para> | 75 <para> |
76 Sets <value>size</value> of the buffer used for reading the first part | 76 Sets the <value>size</value> of the buffer used for reading the first part |
77 of a response received from the FastCGI server. | 77 of a response received from the FastCGI server. |
78 This part usually contains a small response header. | 78 This part usually contains a small response header. |
79 By default, the buffer size is equal to the size of one | 79 By default, the buffer size is equal to the size of one |
80 buffer set by the <link id="fastcgi_buffers"/> directive. | 80 buffer set by the <link id="fastcgi_buffers"/> directive. |
81 It can be made smaller however. | 81 It can be made smaller however. |
113 Limits the total <value>size</value> of buffers that | 113 Limits the total <value>size</value> of buffers that |
114 can be busy sending a response to the client while the response is not | 114 can be busy sending a response to the client while the response is not |
115 yet fully read. | 115 yet fully read. |
116 In the mean time, the rest of the buffers can be used for reading a response | 116 In the mean time, the rest of the buffers can be used for reading a response |
117 and, if needed, buffering part of a response to a temporary file. | 117 and, if needed, buffering part of a response to a temporary file. |
118 By default, <value>size</value> is limited by two buffers set by the | 118 By default, <value>size</value> is limited by the size of two buffers set by the |
119 <link id="fastcgi_buffer_size"/> and <link id="fastcgi_buffers"/> directives. | 119 <link id="fastcgi_buffer_size"/> and <link id="fastcgi_buffers"/> directives. |
120 </para> | 120 </para> |
121 | 121 |
122 </directive> | 122 </directive> |
123 | 123 |
188 <para> | 188 <para> |
189 When enabled, only one request at a time will be allowed to populate | 189 When enabled, only one request at a time will be allowed to populate |
190 a new cache element identified according to the <link id="fastcgi_cache_key"/> | 190 a new cache element identified according to the <link id="fastcgi_cache_key"/> |
191 directive by passing a request to a FastCGI server. | 191 directive by passing a request to a FastCGI server. |
192 Other requests of the same cache element will either wait | 192 Other requests of the same cache element will either wait |
193 for a response to appear in the cache, or the cache lock for | 193 for a response to appear in the cache or the cache lock for |
194 this element to be released, up to the time set by the | 194 this element to be released, up to the time set by the |
195 <link id="fastcgi_cache_lock_timeout"/> directive. | 195 <link id="fastcgi_cache_lock_timeout"/> directive. |
196 </para> | 196 </para> |
197 | 197 |
198 </directive> | 198 </directive> |
263 [<literal>loader_threshold</literal>=<value>time</value>]</syntax> | 263 [<literal>loader_threshold</literal>=<value>time</value>]</syntax> |
264 <default/> | 264 <default/> |
265 <context>http</context> | 265 <context>http</context> |
266 | 266 |
267 <para> | 267 <para> |
268 Sets path and other parameters of a cache. | 268 Sets the path and other parameters of a cache. |
269 Cache data are stored in files. | 269 Cache data are stored in files. |
270 Both the key and file name in a cache are a result of | 270 Both the key and file name in a cache are a result of |
271 applying the MD5 function to the proxied URL. | 271 applying the MD5 function to the proxied URL. |
272 | 272 |
273 The <literal>levels</literal> parameter defines hierarchy levels of a cache. | 273 The <literal>levels</literal> parameter defines hierarchy levels of a cache. |
280 /data/nginx/cache/<emphasis>c</emphasis>/<emphasis>29</emphasis>/b7f54b2df7773722d382f4809d650<emphasis>29c</emphasis> | 280 /data/nginx/cache/<emphasis>c</emphasis>/<emphasis>29</emphasis>/b7f54b2df7773722d382f4809d650<emphasis>29c</emphasis> |
281 </example> | 281 </example> |
282 </para> | 282 </para> |
283 | 283 |
284 <para> | 284 <para> |
285 A cached response is first written to a temporary file, then a file is renamed. | 285 A cached response is first written to a temporary file, |
286 Starting from version 0.8.9 temporary files and the cache can be put on | 286 and then the file is renamed. |
287 different file systems but be aware that in this case a file is copied | 287 Starting from version 0.8.9, temporary files and the cache can be put on |
288 across two file systems instead of the cheap rename operation. | 288 different file systems. |
289 However, be aware that in this case a file is copied | |
290 across two file systems instead of the cheap renaming operation. | |
289 It is thus recommended that for any given location both cache and a directory | 291 It is thus recommended that for any given location both cache and a directory |
290 holding temporary files set by the <link id="fastcgi_temp_path"/> directive | 292 holding temporary files, set by the <link id="fastcgi_temp_path"/> directive, |
291 are put on the same file system. | 293 are put on the same file system. |
292 </para> | 294 </para> |
293 | 295 |
294 <para> | 296 <para> |
295 In addition, all active keys and information about data are stored | 297 In addition, all active keys and information about data are stored |
300 regardless of their freshness. | 302 regardless of their freshness. |
301 By default, <literal>inactive</literal> is set to 10 minutes. | 303 By default, <literal>inactive</literal> is set to 10 minutes. |
302 </para> | 304 </para> |
303 | 305 |
304 <para> | 306 <para> |
305 The special process “cache manager” monitors the maximum cache size set | 307 The special “cache manager” process monitors the maximum cache size set |
306 by the <literal>max_size</literal> parameter; | 308 by the <literal>max_size</literal> parameter. |
307 when this size is exceeded it removes the least recently used data. | 309 When this size is exceeded, it removes the least recently used data. |
308 </para> | 310 </para> |
309 | 311 |
310 <para> | 312 <para> |
311 A minute after the start the special process “cache loader” is activated | 313 A minute after the start the special “cache loader” process is activated. |
312 that loads information about previously cached data stored on file system | 314 It loads information about previously cached data stored on file system |
313 into a cache zone. | 315 into a cache zone. |
314 A load is done in iterations. | 316 The loading is done in iterations. |
315 During one iteration no more than <literal>loader_files</literal> items | 317 During one iteration no more than <literal>loader_files</literal> items |
316 are loaded (by default, 100). | 318 are loaded (by default, 100). |
317 Besides, the duration of one iteration is limited by the | 319 Besides, the duration of one iteration is limited by the |
318 <literal>loader_threshold</literal> parameter (by default, 200 milliseconds). | 320 <literal>loader_threshold</literal> parameter (by default, 200 milliseconds). |
319 A pause is made between iterations, configured by the | 321 Between iterations, a pause configured by the <literal>loader_sleep</literal> |
320 <literal>loader_sleep</literal> parameter (by default, 50 milliseconds). | 322 parameter (by default, 50 milliseconds) is made. |
321 </para> | 323 </para> |
322 | 324 |
323 </directive> | 325 </directive> |
324 | 326 |
325 | 327 |
339 <context>http</context> | 341 <context>http</context> |
340 <context>server</context> | 342 <context>server</context> |
341 <context>location</context> | 343 <context>location</context> |
342 | 344 |
343 <para> | 345 <para> |
344 If an error occurs while working with the FastCGI server it is possible | 346 Determines in which cases a stale cached response can be used |
345 to use a stale cached response. | 347 when an error occurs during communication with the FastCGI server. |
346 This directives determines in which cases it is permitted. | 348 The directive’s parameters match the parameters of the |
347 The directive’s parameters match those of the | |
348 <link id="fastcgi_next_upstream"/> directive. | 349 <link id="fastcgi_next_upstream"/> directive. |
349 </para> | 350 </para> |
350 | 351 |
351 <para> | 352 <para> |
352 Additionally, the <literal>updating</literal> parameter permits | 353 Additionally, the <literal>updating</literal> parameter permits |
353 to use a stale cached response if it is currently being updated. | 354 using a stale cached response if it is currently being updated. |
354 This allows to minimize the number of accesses to FastCGI servers | 355 This allows minimizing the number of accesses to FastCGI servers |
355 when updating cached data. | 356 when updating cached data. |
356 </para> | 357 </para> |
357 | 358 |
358 <para> | 359 <para> |
359 To minimize the number of accesses to FastCGI servers when | 360 To minimize the number of accesses to FastCGI servers when |
376 For example, the following directives | 377 For example, the following directives |
377 <example> | 378 <example> |
378 fastcgi_cache_valid 200 302 10m; | 379 fastcgi_cache_valid 200 302 10m; |
379 fastcgi_cache_valid 404 1m; | 380 fastcgi_cache_valid 404 1m; |
380 </example> | 381 </example> |
381 set 10 minutes of caching for responses with codes 200 and 302, | 382 set 10 minutes of caching for responses with codes 200 and 302 |
382 and 1 minute for responses with code 404. | 383 and 1 minute for responses with code 404. |
383 </para> | 384 </para> |
384 | 385 |
385 <para> | 386 <para> |
386 If only caching <value>time</value> is specified | 387 If only caching <value>time</value> is specified |
389 </example> | 390 </example> |
390 then only 200, 301, and 302 responses are cached. | 391 then only 200, 301, and 302 responses are cached. |
391 </para> | 392 </para> |
392 | 393 |
393 <para> | 394 <para> |
394 In addition, it can be specified to cache any responses using the | 395 In addition, the <literal>any</literal> parameter can be specified |
395 <literal>any</literal> parameter: | 396 to cache any responses: |
396 <example> | 397 <example> |
397 fastcgi_cache_valid 200 302 10m; | 398 fastcgi_cache_valid 200 302 10m; |
398 fastcgi_cache_valid 301 1h; | 399 fastcgi_cache_valid 301 1h; |
399 fastcgi_cache_valid any 1m; | 400 fastcgi_cache_valid any 1m; |
400 </example> | 401 </example> |
401 </para> | 402 </para> |
402 | 403 |
403 <para> | 404 <para> |
404 Parameters of caching can also be set directly | 405 Parameters of caching can also be set directly |
405 in the response header. | 406 in the response header. |
406 This has a higher precedence than setting of caching time using the directive. | 407 This has higher priority than setting of caching time using the directive. |
407 The <header>X-Accel-Expires</header> header field sets caching time of a | 408 The <header>X-Accel-Expires</header> header field sets caching time of a |
408 response in seconds. | 409 response in seconds. |
409 The value 0 disables to cache a response. | 410 The zero value disables caching for a response. |
410 If a value starts with the prefix <literal>@</literal>, it sets an absolute | 411 If a value starts with the <literal>@</literal> prefix, it sets an absolute |
411 time in seconds since Epoch, up to which the response may be cached. | 412 time in seconds since Epoch, up to which the response may be cached. |
412 If header does not include the <header>X-Accel-Expires</header> field, | 413 If header does not include the <header>X-Accel-Expires</header> field, |
413 parameters of caching may be set in the header fields | 414 parameters of caching may be set in the header fields |
414 <header>Expires</header> or <header>Cache-Control</header>. | 415 <header>Expires</header> or <header>Cache-Control</header>. |
415 If a header includes the <header>Set-Cookie</header> field, such a | 416 If a header includes the <header>Set-Cookie</header> field, such a |
430 | 431 |
431 <para> | 432 <para> |
432 Sets a string to search for in the error stream of a response | 433 Sets a string to search for in the error stream of a response |
433 received from a FastCGI server. | 434 received from a FastCGI server. |
434 If the <value>string</value> is found then it is considered that the FastCGI | 435 If the <value>string</value> is found then it is considered that the FastCGI |
435 server returned an <link id="fastcgi_next_upstream">invalid response</link>. | 436 server has returned an <link id="fastcgi_next_upstream">invalid response</link>. |
436 This allows to handle application errors in nginx, for example: | 437 This allows handling application errors in nginx, for example: |
437 <example> | 438 <example> |
438 location /php { | 439 location /php { |
439 fastcgi_pass backend:9000; | 440 fastcgi_pass backend:9000; |
440 ... | 441 ... |
441 fastcgi_catch_stderr "PHP Fatal error"; | 442 fastcgi_catch_stderr "PHP Fatal error"; |
453 <context>http</context> | 454 <context>http</context> |
454 <context>server</context> | 455 <context>server</context> |
455 <context>location</context> | 456 <context>location</context> |
456 | 457 |
457 <para> | 458 <para> |
458 Defines a timeout for establishing a connection with the FastCGI server. | 459 Defines a timeout for establishing a connection with a FastCGI server. |
459 It should be noted that this timeout cannot usually exceed 75 seconds. | 460 It should be noted that this timeout cannot usually exceed 75 seconds. |
460 </para> | 461 </para> |
461 | 462 |
462 </directive> | 463 </directive> |
463 | 464 |
470 <context>location</context> | 471 <context>location</context> |
471 | 472 |
472 <para> | 473 <para> |
473 By default, | 474 By default, |
474 nginx does not pass the header fields <header>Status</header> and | 475 nginx does not pass the header fields <header>Status</header> and |
475 <header>X-Accel-...</header> from the response of the FastCGI | 476 <header>X-Accel-...</header> from the response of a FastCGI |
476 server to a client. | 477 server to a client. |
477 The <literal>fastcgi_hide_header</literal> directive sets additional fields | 478 The <literal>fastcgi_hide_header</literal> directive sets additional fields |
478 that will not be passed. | 479 that will not be passed. |
479 If, on the contrary, the passing of fields needs to be permitted, | 480 If, on the contrary, the passing of fields needs to be permitted, |
480 the <link id="fastcgi_pass_header"/> directive can be used. | 481 the <link id="fastcgi_pass_header"/> directive can be used. |
489 <context>http</context> | 490 <context>http</context> |
490 <context>server</context> | 491 <context>server</context> |
491 <context>location</context> | 492 <context>location</context> |
492 | 493 |
493 <para> | 494 <para> |
494 Determines should the connection with the FastCGI server be | 495 Determines whether the connection with a FastCGI server should be |
495 closed if a client closes a connection without waiting | 496 closed when a client closes a connection without waiting |
496 for a response. | 497 for a response. |
497 </para> | 498 </para> |
498 | 499 |
499 </directive> | 500 </directive> |
500 | 501 |
514 <header>X-Accel-Charset</header> (1.1.6), <header>Expires</header>, | 515 <header>X-Accel-Charset</header> (1.1.6), <header>Expires</header>, |
515 <header>Cache-Control</header>, and <header>Set-Cookie</header> (0.8.44). | 516 <header>Cache-Control</header>, and <header>Set-Cookie</header> (0.8.44). |
516 </para> | 517 </para> |
517 | 518 |
518 <para> | 519 <para> |
519 If not disabled, processing of these header fields has the following effect: | 520 If not disabled, processing of these header fields has the following |
521 effect: | |
520 <list type="bullet" compact="no"> | 522 <list type="bullet" compact="no"> |
521 | 523 |
522 <listitem> | 524 <listitem> |
523 <header>X-Accel-Expires</header>, <header>Expires</header>, | 525 <header>X-Accel-Expires</header>, <header>Expires</header>, |
524 <header>Cache-Control</header>, and <header>Set-Cookie</header> | 526 <header>Cache-Control</header>, and <header>Set-Cookie</header> |
525 set parameters of response <link id="fastcgi_cache_valid">caching</link>; | 527 set the parameters of response <link id="fastcgi_cache_valid">caching</link>; |
526 </listitem> | 528 </listitem> |
527 | 529 |
528 <listitem> | 530 <listitem> |
529 <header>X-Accel-Redirect</header> performs an | 531 <header>X-Accel-Redirect</header> performs an |
530 <link doc="ngx_http_core_module.xml" id="internal">internal | 532 <link doc="ngx_http_core_module.xml" id="internal">internal |
531 redirect</link> to the specified URI; | 533 redirect</link> to the specified URI; |
532 </listitem> | 534 </listitem> |
533 | 535 |
534 <listitem> | 536 <listitem> |
535 <header>X-Accel-Limit-Rate</header> sets a | 537 <header>X-Accel-Limit-Rate</header> sets the |
536 <link doc="ngx_http_core_module.xml" id="limit_rate">rate | 538 <link doc="ngx_http_core_module.xml" id="limit_rate">rate |
537 limit</link> for transmission of a response to a client; | 539 limit</link> for transmission of a response to a client; |
538 </listitem> | 540 </listitem> |
539 | 541 |
540 <listitem> | 542 <listitem> |
587 <context>location</context> | 589 <context>location</context> |
588 | 590 |
589 <para> | 591 <para> |
590 Determines whether FastCGI server responses with codes greater than or equal | 592 Determines whether FastCGI server responses with codes greater than or equal |
591 to 300 should be passed to a client or be redirected to nginx for processing | 593 to 300 should be passed to a client or be redirected to nginx for processing |
592 using the <link doc="ngx_http_core_module.xml" id="error_page"/> directive. | 594 with the <link doc="ngx_http_core_module.xml" id="error_page"/> directive. |
593 </para> | 595 </para> |
594 | 596 |
595 </directive> | 597 </directive> |
596 | 598 |
597 | 599 |
604 <appeared-in>1.1.4</appeared-in> | 606 <appeared-in>1.1.4</appeared-in> |
605 | 607 |
606 <para> | 608 <para> |
607 By default, a FastCGI server will close a connection right after | 609 By default, a FastCGI server will close a connection right after |
608 sending the response. | 610 sending the response. |
609 When set to the value <literal>on</literal>, nginx will instruct | 611 However, when this directive is set to the value <literal>on</literal>, |
610 a FastCGI server to keep connections open. | 612 nginx will instruct a FastCGI server to keep connections open. |
611 This in particular is necessary for | 613 This is necessary, in particular, for |
612 <link doc="ngx_http_upstream_module.xml" id="keepalive"/> | 614 <link doc="ngx_http_upstream_module.xml" id="keepalive"/> |
613 connections to FastCGI servers to function. | 615 connections to FastCGI servers to function. |
614 </para> | 616 </para> |
615 | 617 |
616 </directive> | 618 </directive> |
622 <context>http</context> | 624 <context>http</context> |
623 <context>server</context> | 625 <context>server</context> |
624 <context>location</context> | 626 <context>location</context> |
625 | 627 |
626 <para> | 628 <para> |
627 When the whole response does not fit into memory buffers | 629 When the whole response does not fit into the memory buffers |
628 set by the <link id="fastcgi_buffer_size"/> and <link id="fastcgi_buffers"/> | 630 set by the <link id="fastcgi_buffer_size"/> and <link id="fastcgi_buffers"/> |
629 directives, part of a response can be saved to a temporary file. | 631 directives, a part of the response can be saved to a temporary file. |
630 This directive sets the maximum <value>size</value> of a temporary file. | 632 This directive sets the maximum <value>size</value> of a temporary file. |
631 The size of data written to a temporary file at a time is set | 633 The size of data written to a temporary file at a time is set |
632 by the <link id="fastcgi_temp_file_write_size"/> directive. | 634 by the <link id="fastcgi_temp_file_write_size"/> directive. |
633 </para> | 635 </para> |
634 | 636 |
635 <para> | 637 <para> |
636 Value of zero disables buffering of responses to temporary files. | 638 The zero value disables buffering of responses to temporary files. |
637 </para> | 639 </para> |
638 | 640 |
639 </directive> | 641 </directive> |
640 | 642 |
641 | 643 |
659 Specifies in which cases a request should be passed to the next server: | 661 Specifies in which cases a request should be passed to the next server: |
660 <list type="tag"> | 662 <list type="tag"> |
661 | 663 |
662 <tag-name><literal>error</literal></tag-name> | 664 <tag-name><literal>error</literal></tag-name> |
663 <tag-desc>an error occurred while establishing a connection with the | 665 <tag-desc>an error occurred while establishing a connection with the |
664 server, passing it a request, or reading the response header;</tag-desc> | 666 server, passing a request to it, or reading the response header;</tag-desc> |
665 | 667 |
666 <tag-name><literal>timeout</literal></tag-name> | 668 <tag-name><literal>timeout</literal></tag-name> |
667 <tag-desc>a timeout has occurred while establishing a connection with the | 669 <tag-desc>a timeout has occurred while establishing a connection with the |
668 server, passing it a request, or reading the response header;</tag-desc> | 670 server, passing a request to it, or reading the response header;</tag-desc> |
669 | 671 |
670 <tag-name><literal>invalid_header</literal></tag-name> | 672 <tag-name><literal>invalid_header</literal></tag-name> |
671 <tag-desc>a server returned empty or invalid response;</tag-desc> | 673 <tag-desc>a server returned an empty or invalid response;</tag-desc> |
672 | 674 |
673 <tag-name><literal>http_500</literal></tag-name> | 675 <tag-name><literal>http_500</literal></tag-name> |
674 <tag-desc>a server returned a response with the code 500;</tag-desc> | 676 <tag-desc>a server returned a response with the code 500;</tag-desc> |
675 | 677 |
676 <tag-name><literal>http_503</literal></tag-name> | 678 <tag-name><literal>http_503</literal></tag-name> |
687 | 689 |
688 </list> | 690 </list> |
689 </para> | 691 </para> |
690 | 692 |
691 <para> | 693 <para> |
692 It should be understood that passing a request to the next server is | 694 One should bear in mind that passing a request to the next server is |
693 only possible if a client was not sent anything yet. | 695 only possible if nothing has been sent to a client yet. |
694 That is, if an error or a timeout occurs in the middle of | 696 That is, if an error or timeout occurs in the middle of the |
695 transferring a response, fixing this is impossible. | 697 transferring of a response, fixing this is impossible. |
696 </para> | 698 </para> |
697 | 699 |
698 <para> | 700 <para> |
699 The directive also defines what is considered an unsuccessful attempt | 701 The directive also defines what is considered an unsuccessful attempt |
700 of communication with a | 702 of communication with a |
799 <default/> | 801 <default/> |
800 <context>location</context> | 802 <context>location</context> |
801 <context>if in location</context> | 803 <context>if in location</context> |
802 | 804 |
803 <para> | 805 <para> |
804 Sets an address of the FastCGI server. | 806 Sets the address of a FastCGI server. |
805 An address can be specified as a domain name or an address, and a port, | 807 The address can be specified as a domain name or IP address, |
806 for example, | 808 and an optional port: |
807 <example> | 809 <example> |
808 fastcgi_pass localhost:9000; | 810 fastcgi_pass localhost:9000; |
809 </example> | 811 </example> |
810 or as a UNIX-domain socket path: | 812 or as a UNIX-domain socket path: |
811 <example> | 813 <example> |
829 <context>http</context> | 831 <context>http</context> |
830 <context>server</context> | 832 <context>server</context> |
831 <context>location</context> | 833 <context>location</context> |
832 | 834 |
833 <para> | 835 <para> |
834 Permits to pass <link id="fastcgi_hide_header">otherwise disabled</link> header | 836 Permits passing <link id="fastcgi_hide_header">otherwise disabled</link> header |
835 fields from the FastCGI server to a client. | 837 fields from a FastCGI server to a client. |
836 </para> | 838 </para> |
837 | 839 |
838 </directive> | 840 </directive> |
839 | 841 |
840 | 842 |
845 <context>server</context> | 847 <context>server</context> |
846 <context>location</context> | 848 <context>location</context> |
847 | 849 |
848 <para> | 850 <para> |
849 Defines a timeout for reading a response from the FastCGI server. | 851 Defines a timeout for reading a response from the FastCGI server. |
850 A timeout is only set between two successive read operations, | 852 A timeout is set only between two successive read operations, |
851 not for the transmission of the whole response. | 853 not for the transmission of the whole response. |
852 If a FastCGI server does not transmit anything within this time, | 854 If a FastCGI server does not transmit anything within this time, |
853 a connection is closed. | 855 a connection is closed. |
854 </para> | 856 </para> |
855 | 857 |
862 <context>http</context> | 864 <context>http</context> |
863 <context>server</context> | 865 <context>server</context> |
864 <context>location</context> | 866 <context>location</context> |
865 | 867 |
866 <para> | 868 <para> |
867 If disabled, the original request body will not be passed | 869 Indicates whether the original request body is passed |
868 to the FastCGI server. | 870 to the FastCGI server. |
869 See also the <link id="fastcgi_pass_request_headers"/> directive. | 871 See also the <link id="fastcgi_pass_request_headers"/> directive. |
870 </para> | 872 </para> |
871 | 873 |
872 </directive> | 874 </directive> |
878 <context>http</context> | 880 <context>http</context> |
879 <context>server</context> | 881 <context>server</context> |
880 <context>location</context> | 882 <context>location</context> |
881 | 883 |
882 <para> | 884 <para> |
883 If disabled, header fields of the original request will not be passed to the | 885 Indicates whether the header fields of the original request are passed |
884 FastCGI server. | 886 to the FastCGI server. |
885 See also the <link id="fastcgi_pass_request_body"/> directive. | 887 See also the <link id="fastcgi_pass_request_body"/> directive. |
886 </para> | 888 </para> |
887 | 889 |
888 </directive> | 890 </directive> |
889 | 891 |
894 <context>http</context> | 896 <context>http</context> |
895 <context>server</context> | 897 <context>server</context> |
896 <context>location</context> | 898 <context>location</context> |
897 | 899 |
898 <para> | 900 <para> |
899 If set to a non-zero value, nginx will try to minimize the number | 901 If the directive is set to a non-zero value, nginx will try to |
902 minimize the number | |
900 of send operations on outgoing connections to a FastCGI server by using either | 903 of send operations on outgoing connections to a FastCGI server by using either |
901 <c-def>NOTE_LOWAT</c-def> flag of the | 904 <c-def>NOTE_LOWAT</c-def> flag of the |
902 <link doc="../events.xml" id="kqueue"/> method, | 905 <link doc="../events.xml" id="kqueue"/> method, |
903 or the <c-def>SO_SNDLOWAT</c-def> socket option, | 906 or the <c-def>SO_SNDLOWAT</c-def> socket option, |
904 with the specified <value>size</value>. | 907 with the specified <value>size</value>. |
918 <context>server</context> | 921 <context>server</context> |
919 <context>location</context> | 922 <context>location</context> |
920 | 923 |
921 <para> | 924 <para> |
922 Sets a timeout for transmitting a request to the FastCGI server. | 925 Sets a timeout for transmitting a request to the FastCGI server. |
923 A timeout is only set between two successive write operations, | 926 A timeout is set only between two successive write operations, |
924 not for the transmission of the whole request. | 927 not for the transmission of the whole request. |
925 If a FastCGI server does not receive anything within this time, | 928 If a FastCGI server does not receive anything within this time, |
926 a connection is closed. | 929 a connection is closed. |
927 </para> | 930 </para> |
928 | 931 |
935 <context>location</context> | 938 <context>location</context> |
936 | 939 |
937 <para> | 940 <para> |
938 Defines a regular expression that captures a value for the | 941 Defines a regular expression that captures a value for the |
939 <var>$fastcgi_path_info</var> variable. | 942 <var>$fastcgi_path_info</var> variable. |
940 A regular expression should have two captures, the first becomes | 943 A regular expression should have two captures: the first becomes |
941 a value of the <var>$fastcgi_script_name</var> variable, the second | 944 a value of the <var>$fastcgi_script_name</var> variable, the second |
942 becomes a value of the <var>$fastcgi_path_info</var> variable. | 945 becomes a value of the <var>$fastcgi_path_info</var> variable. |
943 For example, with these settings | 946 For example, with these settings |
944 <example> | 947 <example> |
945 location ~ ^(.+\.php)(.*)$ { | 948 location ~ ^(.+\.php)(.*)$ { |
982 </para> | 985 </para> |
983 | 986 |
984 <para> | 987 <para> |
985 The modification time of files is set according to the received | 988 The modification time of files is set according to the received |
986 <header>Last-Modified</header> response header field. | 989 <header>Last-Modified</header> response header field. |
987 A response is first written to a temporary file, then a file is renamed. | 990 A response is first written to a temporary file, and then the file is renamed. |
988 Starting from version 0.8.9 temporary files and the persistent store | 991 Starting from version 0.8.9, temporary files and the persistent store |
989 can be put on different file systems but be aware that in this case | 992 can be put on different file systems. |
990 a file is copied across two file systems instead of the cheap rename operation. | 993 However, be aware that in this case a file is copied |
994 across two file systems instead of the cheap renaming operation. | |
991 It is thus recommended that for any given location both saved files and a | 995 It is thus recommended that for any given location both saved files and a |
992 directory holding temporary files set by the <link id="fastcgi_temp_path"/> | 996 directory holding temporary files, set by the <link id="fastcgi_temp_path"/> |
993 directive are put on the same file system. | 997 directive, are put on the same file system. |
994 </para> | 998 </para> |
995 | 999 |
996 <para> | 1000 <para> |
997 This directive can be used to create local copies of static unchangeable | 1001 This directive can be used to create local copies of static unchangeable |
998 files, e.g.: | 1002 files, e.g.: |
1103 HTTP request header fields are passed to the FastCGI server as parameters. | 1107 HTTP request header fields are passed to the FastCGI server as parameters. |
1104 In applications and scripts running as FastCGI servers, | 1108 In applications and scripts running as FastCGI servers, |
1105 these parameters are usually made available as environment variables. | 1109 these parameters are usually made available as environment variables. |
1106 For example, the <header>User-Agent</header> header field is passed as the | 1110 For example, the <header>User-Agent</header> header field is passed as the |
1107 <literal>HTTP_USER_AGENT</literal> parameter. | 1111 <literal>HTTP_USER_AGENT</literal> parameter. |
1108 In addition to HTTP request header fields it is possible to pass arbitrary | 1112 In addition to HTTP request header fields, it is possible to pass arbitrary |
1109 parameters using the <link id="fastcgi_param"/> directive. | 1113 parameters using the <link id="fastcgi_param"/> directive. |
1110 </para> | 1114 </para> |
1111 | 1115 |
1112 </section> | 1116 </section> |
1113 | 1117 |
1136 the <literal>SCRIPT_FILENAME</literal> parameter will be equal to | 1140 the <literal>SCRIPT_FILENAME</literal> parameter will be equal to |
1137 “<literal>/home/www/scripts/php/info/index.php</literal>”. | 1141 “<literal>/home/www/scripts/php/info/index.php</literal>”. |
1138 | 1142 |
1139 <para> | 1143 <para> |
1140 When using the <link id="fastcgi_split_path_info"/> directive, | 1144 When using the <link id="fastcgi_split_path_info"/> directive, |
1141 the <var>$fastcgi_script_name</var> variable equals to the value of | 1145 the <var>$fastcgi_script_name</var> variable equals the value of |
1142 the first capture set by the directive. | 1146 the first capture set by the directive. |
1143 </para> | 1147 </para> |
1144 </tag-desc> | 1148 </tag-desc> |
1145 | 1149 |
1146 <tag-name><var>$fastcgi_path_info</var></tag-name> | 1150 <tag-name><var>$fastcgi_path_info</var></tag-name> |