Mercurial > hg > nginx-site
annotate xml/en/docs/http/ngx_http_scgi_module.xml @ 1363:82388d3b8e90
Donor added.
author | Maxim Konovalov <maxim@nginx.com> |
---|---|
date | Fri, 21 Nov 2014 09:14:07 +0000 |
parents | 25db29c8875e |
children | 91f5c089f4ca |
rev | line source |
---|---|
1180 | 1 <?xml version="1.0"?> |
2 | |
3 <!-- | |
4 Copyright (C) Igor Sysoev | |
5 Copyright (C) Nginx, Inc. | |
6 --> | |
7 | |
8 <!DOCTYPE module SYSTEM "../../../../dtd/module.dtd"> | |
9 | |
10 <module name="Module ngx_http_scgi_module" | |
11 link="/en/docs/http/ngx_http_scgi_module.html" | |
12 lang="en" | |
1353
25db29c8875e
Documented how the "Vary" response header field affects caching.
Ruslan Ermilov <ru@nginx.com>
parents:
1352
diff
changeset
|
13 rev="12"> |
1180 | 14 |
15 <section id="summary"> | |
16 | |
17 <para> | |
18 The <literal>ngx_http_scgi_module</literal> module allows passing | |
19 requests to an SCGI server. | |
20 </para> | |
21 | |
22 </section> | |
23 | |
24 | |
25 <section id="example" name="Example Configuration"> | |
26 | |
27 <para> | |
28 <example> | |
29 location / { | |
30 include scgi_params; | |
31 scgi_pass localhost:9000; | |
32 } | |
33 </example> | |
34 </para> | |
35 | |
36 </section> | |
37 | |
38 | |
39 <section id="directives" name="Directives"> | |
40 | |
41 <directive name="scgi_bind"> | |
42 <syntax><value>address</value> | <literal>off</literal></syntax> | |
43 <default/> | |
44 <context>http</context> | |
45 <context>server</context> | |
46 <context>location</context> | |
47 | |
48 <para> | |
49 Makes outgoing connections to an SCGI server originate | |
50 from the specified local IP <value>address</value>. | |
51 Parameter value can contain variables (1.3.12). | |
52 The special value <literal>off</literal> (1.3.12) cancels the effect | |
53 of the <literal>scgi_bind</literal> directive | |
54 inherited from the previous configuration level, which allows the | |
55 system to auto-assign the local IP address. | |
56 </para> | |
57 | |
58 </directive> | |
59 | |
60 | |
61 <directive name="scgi_buffer_size"> | |
62 <syntax><value>size</value></syntax> | |
63 <default>4k|8k</default> | |
64 <context>http</context> | |
65 <context>server</context> | |
66 <context>location</context> | |
67 | |
68 <para> | |
69 Sets the <value>size</value> of the buffer used for reading the first part | |
70 of the response received from the SCGI server. | |
71 This part usually contains a small response header. | |
72 By default, the buffer size is equal to the size of one | |
73 buffer set by the <link id="scgi_buffers"/> directive. | |
74 It can be made smaller, however. | |
75 </para> | |
76 | |
77 </directive> | |
78 | |
79 | |
80 <directive name="scgi_buffering"> | |
81 <syntax><literal>on</literal> | <literal>off</literal></syntax> | |
82 <default>on</default> | |
83 <context>http</context> | |
84 <context>server</context> | |
85 <context>location</context> | |
86 | |
87 <para> | |
88 Enables or disables buffering of responses from the SCGI server. | |
89 </para> | |
90 | |
91 <para> | |
92 When buffering is enabled, nginx receives a response from the SCGI server | |
93 as soon as possible, saving it into the buffers set by the | |
94 <link id="scgi_buffer_size"/> and <link id="scgi_buffers"/> directives. | |
95 If the whole response does not fit into memory, a part of it can be saved | |
96 to a <link id="scgi_temp_path">temporary file</link> on the disk. | |
97 Writing to temporary files is controlled by the | |
98 <link id="scgi_max_temp_file_size"/> and | |
99 <link id="scgi_temp_file_write_size"/> directives. | |
100 </para> | |
101 | |
102 <para> | |
103 When buffering is disabled, the response is passed to a client synchronously, | |
104 immediately as it is received. | |
105 nginx will not try to read the whole response from the SCGI server. | |
106 The maximum size of the data that nginx can receive from the server | |
107 at a time is set by the <link id="scgi_buffer_size"/> directive. | |
108 </para> | |
109 | |
110 <para> | |
111 Buffering can also be enabled or disabled by passing | |
112 “<literal>yes</literal>” or “<literal>no</literal>” in the | |
113 <header>X-Accel-Buffering</header> response header field. | |
114 This capability can be disabled using the | |
115 <link id="scgi_ignore_headers"/> directive. | |
116 </para> | |
117 | |
118 </directive> | |
119 | |
120 | |
121 <directive name="scgi_buffers"> | |
122 <syntax><value>number</value> <value>size</value></syntax> | |
123 <default>8 4k|8k</default> | |
124 <context>http</context> | |
125 <context>server</context> | |
126 <context>location</context> | |
127 | |
128 <para> | |
129 Sets the <value>number</value> and <value>size</value> of the | |
130 buffers used for reading a response from the SCGI server, | |
131 for a single connection. | |
132 By default, the buffer size is equal to one memory page. | |
133 This is either 4K or 8K, depending on a platform. | |
134 </para> | |
135 | |
136 </directive> | |
137 | |
138 | |
139 <directive name="scgi_busy_buffers_size"> | |
140 <syntax><value>size</value></syntax> | |
141 <default>8k|16k</default> | |
142 <context>http</context> | |
143 <context>server</context> | |
144 <context>location</context> | |
145 | |
146 <para> | |
147 When <link id="scgi_buffering">buffering</link> of responses from the SCGI | |
148 server is enabled, limits the total <value>size</value> of buffers that | |
149 can be busy sending a response to the client while the response is not | |
150 yet fully read. | |
151 In the meantime, the rest of the buffers can be used for reading the response | |
152 and, if needed, buffering part of the response to a temporary file. | |
153 By default, <value>size</value> is limited by the size of two buffers set by the | |
154 <link id="scgi_buffer_size"/> and <link id="scgi_buffers"/> directives. | |
155 </para> | |
156 | |
157 </directive> | |
158 | |
159 | |
160 <directive name="scgi_cache"> | |
161 <syntax><value>zone</value> | <literal>off</literal></syntax> | |
162 <default>off</default> | |
163 <context>http</context> | |
164 <context>server</context> | |
165 <context>location</context> | |
166 | |
167 <para> | |
168 Defines a shared memory zone used for caching. | |
169 The same zone can be used in several places. | |
170 The <literal>off</literal> parameter disables caching inherited | |
171 from the previous configuration level. | |
172 </para> | |
173 | |
174 </directive> | |
175 | |
176 | |
177 <directive name="scgi_cache_bypass"> | |
178 <syntax><value>string</value> ...</syntax> | |
179 <default/> | |
180 <context>http</context> | |
181 <context>server</context> | |
182 <context>location</context> | |
183 | |
184 <para> | |
185 Defines conditions under which the response will not be taken from a cache. | |
186 If at least one value of the string parameters is not empty and is not | |
187 equal to “0” then the response will not be taken from the cache: | |
188 <example> | |
189 scgi_cache_bypass $cookie_nocache $arg_nocache$arg_comment; | |
190 scgi_cache_bypass $http_pragma $http_authorization; | |
191 </example> | |
192 Can be used along with the <link id="scgi_no_cache"/> directive. | |
193 </para> | |
194 | |
195 </directive> | |
196 | |
197 | |
198 <directive name="scgi_cache_key"> | |
199 <syntax><value>string</value></syntax> | |
200 <default/> | |
201 <context>http</context> | |
202 <context>server</context> | |
203 <context>location</context> | |
204 | |
205 <para> | |
206 Defines a key for caching, for example | |
207 <example> | |
208 scgi_cache_key localhost:9000$request_uri; | |
209 </example> | |
210 </para> | |
211 | |
212 </directive> | |
213 | |
214 | |
215 <directive name="scgi_cache_lock"> | |
216 <syntax><literal>on</literal> | <literal>off</literal></syntax> | |
217 <default>off</default> | |
218 <context>http</context> | |
219 <context>server</context> | |
220 <context>location</context> | |
221 <appeared-in>1.1.12</appeared-in> | |
222 | |
223 <para> | |
224 When enabled, only one request at a time will be allowed to populate | |
225 a new cache element identified according to the <link id="scgi_cache_key"/> | |
226 directive by passing a request to an SCGI server. | |
227 Other requests of the same cache element will either wait | |
228 for a response to appear in the cache or the cache lock for | |
229 this element to be released, up to the time set by the | |
230 <link id="scgi_cache_lock_timeout"/> directive. | |
231 </para> | |
232 | |
233 </directive> | |
234 | |
235 | |
236 <directive name="scgi_cache_lock_timeout"> | |
237 <syntax><value>time</value></syntax> | |
238 <default>5s</default> | |
239 <context>http</context> | |
240 <context>server</context> | |
241 <context>location</context> | |
242 <appeared-in>1.1.12</appeared-in> | |
243 | |
244 <para> | |
245 Sets a timeout for <link id="scgi_cache_lock"/>. | |
246 </para> | |
247 | |
248 </directive> | |
249 | |
250 | |
251 <directive name="scgi_cache_methods"> | |
252 <syntax> | |
253 <literal>GET</literal> | | |
254 <literal>HEAD</literal> | | |
255 <literal>POST</literal> | |
256 ...</syntax> | |
257 <default>GET HEAD</default> | |
258 <context>http</context> | |
259 <context>server</context> | |
260 <context>location</context> | |
261 | |
262 <para> | |
263 If the client request method is listed in this directive then | |
264 the response will be cached. | |
265 “<literal>GET</literal>” and “<literal>HEAD</literal>” methods are always | |
266 added to the list, though it is recommended to specify them explicitly. | |
267 See also the <link id="scgi_no_cache"/> directive. | |
268 </para> | |
269 | |
270 </directive> | |
271 | |
272 | |
273 <directive name="scgi_cache_min_uses"> | |
274 <syntax><value>number</value></syntax> | |
275 <default>1</default> | |
276 <context>http</context> | |
277 <context>server</context> | |
278 <context>location</context> | |
279 | |
280 <para> | |
281 Sets the <value>number</value> of requests after which the response | |
282 will be cached. | |
283 </para> | |
284 | |
285 </directive> | |
286 | |
287 | |
288 <directive name="scgi_cache_path"> | |
289 <syntax> | |
290 <value>path</value> | |
291 [<literal>levels</literal>=<value>levels</value>] | |
292 <literal>keys_zone</literal>=<value>name</value>:<value>size</value> | |
293 [<literal>inactive</literal>=<value>time</value>] | |
294 [<literal>max_size</literal>=<value>size</value>] | |
295 [<literal>loader_files</literal>=<value>number</value>] | |
296 [<literal>loader_sleep</literal>=<value>time</value>] | |
297 [<literal>loader_threshold</literal>=<value>time</value>]</syntax> | |
298 <default/> | |
299 <context>http</context> | |
300 | |
301 <para> | |
302 Sets the path and other parameters of a cache. | |
303 Cache data are stored in files. | |
1190
dd4cfc6ce770
Corrected description of *_cache_path file names.
Ruslan Ermilov <ru@nginx.com>
parents:
1189
diff
changeset
|
304 The file name in a cache is a result of |
dd4cfc6ce770
Corrected description of *_cache_path file names.
Ruslan Ermilov <ru@nginx.com>
parents:
1189
diff
changeset
|
305 applying the MD5 function to the |
dd4cfc6ce770
Corrected description of *_cache_path file names.
Ruslan Ermilov <ru@nginx.com>
parents:
1189
diff
changeset
|
306 <link id="scgi_cache_key">cache key</link>. |
1180 | 307 The <literal>levels</literal> parameter defines hierarchy levels of a cache. |
308 For example, in the following configuration | |
309 <example> | |
310 scgi_cache_path /data/nginx/cache levels=1:2 keys_zone=one:10m; | |
311 </example> | |
312 file names in a cache will look like this: | |
313 <example> | |
314 /data/nginx/cache/<emphasis>c</emphasis>/<emphasis>29</emphasis>/b7f54b2df7773722d382f4809d650<emphasis>29c</emphasis> | |
315 </example> | |
316 </para> | |
317 | |
318 <para> | |
319 A cached response is first written to a temporary file, | |
320 and then the file is renamed. | |
321 Starting from version 0.8.9, temporary files and the cache can be put on | |
322 different file systems. | |
323 However, be aware that in this case a file is copied | |
324 across two file systems instead of the cheap renaming operation. | |
325 It is thus recommended that for any given location both cache and a directory | |
326 holding temporary files, set by the <link id="scgi_temp_path"/> directive, | |
327 are put on the same file system. | |
328 </para> | |
329 | |
330 <para> | |
331 In addition, all active keys and information about data are stored | |
332 in a shared memory zone, whose <value>name</value> and <value>size</value> | |
333 are configured by the <literal>keys_zone</literal> parameter. | |
1189
f25d00109de0
Documented cache keys_zone memory estimates.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1185
diff
changeset
|
334 One megabyte zone can store about 8 thousand keys. |
f25d00109de0
Documented cache keys_zone memory estimates.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1185
diff
changeset
|
335 </para> |
f25d00109de0
Documented cache keys_zone memory estimates.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1185
diff
changeset
|
336 |
f25d00109de0
Documented cache keys_zone memory estimates.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1185
diff
changeset
|
337 <para> |
1180 | 338 Cached data that are not accessed during the time specified by the |
339 <literal>inactive</literal> parameter get removed from the cache | |
340 regardless of their freshness. | |
341 By default, <literal>inactive</literal> is set to 10 minutes. | |
342 </para> | |
343 | |
344 <para> | |
345 The special “cache manager” process monitors the maximum cache size set | |
346 by the <literal>max_size</literal> parameter. | |
347 When this size is exceeded, it removes the least recently used data. | |
348 </para> | |
349 | |
350 <para> | |
351 A minute after the start the special “cache loader” process is activated. | |
352 It loads information about previously cached data stored on file system | |
353 into a cache zone. | |
354 The loading is done in iterations. | |
355 During one iteration no more than <literal>loader_files</literal> items | |
356 are loaded (by default, 100). | |
357 Besides, the duration of one iteration is limited by the | |
358 <literal>loader_threshold</literal> parameter (by default, 200 milliseconds). | |
359 Between iterations, a pause configured by the <literal>loader_sleep</literal> | |
360 parameter (by default, 50 milliseconds) is made. | |
361 </para> | |
362 | |
363 </directive> | |
364 | |
365 | |
366 <directive name="scgi_cache_purge"> | |
367 <syntax>string ...</syntax> | |
368 <default/> | |
369 <context>http</context> | |
370 <context>server</context> | |
371 <context>location</context> | |
372 <appeared-in>1.5.7</appeared-in> | |
373 | |
374 <para> | |
375 Defines conditions under which the request will be considered a cache | |
376 purge request. | |
377 If at least one value of the string parameters is not empty and is not equal | |
378 to “0” then the cache entry with a corresponding | |
379 <link id="scgi_cache_key">cache key</link> is removed. | |
380 The result of successful operation is indicated by returning | |
381 the <http-status code="204" text="No Content"/> response. | |
382 </para> | |
383 | |
384 <para> | |
385 If the <link id="scgi_cache_key">cache key</link> of a purge request ends | |
386 with an asterisk (“<literal>*</literal>”), all cache entries matching the | |
387 wildcard key will be removed from the cache. | |
388 </para> | |
389 | |
390 <para> | |
391 Example configuration: | |
392 <example> | |
393 scgi_cache_path /data/nginx/cache keys_zone=cache_zone:10m; | |
394 | |
395 map $request_method $purge_method { | |
396 PURGE 1; | |
397 default 0; | |
398 } | |
399 | |
400 server { | |
401 ... | |
402 location / { | |
1185
f9c8336fe43c
Aligned configuration examples with fastcgi/scgi_cache_purge.
Ruslan Ermilov <ru@nginx.com>
parents:
1184
diff
changeset
|
403 scgi_pass backend; |
f9c8336fe43c
Aligned configuration examples with fastcgi/scgi_cache_purge.
Ruslan Ermilov <ru@nginx.com>
parents:
1184
diff
changeset
|
404 scgi_cache cache_zone; |
f9c8336fe43c
Aligned configuration examples with fastcgi/scgi_cache_purge.
Ruslan Ermilov <ru@nginx.com>
parents:
1184
diff
changeset
|
405 scgi_cache_key $uri; |
1180 | 406 scgi_cache_purge $purge_method; |
407 } | |
408 } | |
409 </example> | |
410 <note> | |
411 This functionality is available as part of our | |
412 <commercial_version>commercial subscription</commercial_version>. | |
413 </note> | |
414 </para> | |
415 | |
416 </directive> | |
417 | |
418 | |
419 <directive name="scgi_cache_revalidate"> | |
420 <syntax><literal>on</literal> | <literal>off</literal></syntax> | |
421 <default>off</default> | |
422 <context>http</context> | |
423 <context>server</context> | |
424 <context>location</context> | |
425 <appeared-in>1.5.7</appeared-in> | |
426 | |
427 <para> | |
428 Enables revalidation of expired cache items using conditional requests with | |
1246
5be7716a5684
Documented If-None-Match in proxy_cache_revalidate and friends.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1190
diff
changeset
|
429 the <header>If-Modified-Since</header> and <header>If-None-Match</header> |
5be7716a5684
Documented If-None-Match in proxy_cache_revalidate and friends.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1190
diff
changeset
|
430 header fields. |
1180 | 431 </para> |
432 | |
433 </directive> | |
434 | |
435 | |
436 <directive name="scgi_cache_use_stale"> | |
437 <syntax> | |
438 <literal>error</literal> | | |
439 <literal>timeout</literal> | | |
440 <literal>invalid_header</literal> | | |
441 <literal>updating</literal> | | |
442 <literal>http_500</literal> | | |
443 <literal>http_503</literal> | | |
444 <literal>http_403</literal> | | |
445 <literal>http_404</literal> | | |
446 <literal>off</literal> | |
447 ...</syntax> | |
448 <default>off</default> | |
449 <context>http</context> | |
450 <context>server</context> | |
451 <context>location</context> | |
452 | |
453 <para> | |
454 Determines in which cases a stale cached response can be used | |
455 when an error occurs during communication with the SCGI server. | |
456 The directive’s parameters match the parameters of the | |
457 <link id="scgi_next_upstream"/> directive. | |
458 </para> | |
459 | |
460 <para> | |
461 Additionally, the <literal>updating</literal> parameter permits | |
462 using a stale cached response if it is currently being updated. | |
463 This allows minimizing the number of accesses to SCGI servers | |
464 when updating cached data. | |
465 </para> | |
466 | |
467 <para> | |
468 To minimize the number of accesses to SCGI servers when | |
469 populating a new cache element, the <link id="scgi_cache_lock"/> | |
470 directive can be used. | |
471 </para> | |
472 | |
473 </directive> | |
474 | |
475 | |
476 <directive name="scgi_cache_valid"> | |
477 <syntax>[<value>code</value> ...] <value>time</value></syntax> | |
478 <default/> | |
479 <context>http</context> | |
480 <context>server</context> | |
481 <context>location</context> | |
482 | |
483 <para> | |
484 Sets caching time for different response codes. | |
485 For example, the following directives | |
486 <example> | |
487 scgi_cache_valid 200 302 10m; | |
488 scgi_cache_valid 404 1m; | |
489 </example> | |
490 set 10 minutes of caching for responses with codes 200 and 302 | |
491 and 1 minute for responses with code 404. | |
492 </para> | |
493 | |
494 <para> | |
495 If only caching <value>time</value> is specified | |
496 <example> | |
497 scgi_cache_valid 5m; | |
498 </example> | |
499 then only 200, 301, and 302 responses are cached. | |
500 </para> | |
501 | |
502 <para> | |
503 In addition, the <literal>any</literal> parameter can be specified | |
504 to cache any responses: | |
505 <example> | |
506 scgi_cache_valid 200 302 10m; | |
507 scgi_cache_valid 301 1h; | |
508 scgi_cache_valid any 1m; | |
509 </example> | |
510 </para> | |
511 | |
512 <para> | |
513 Parameters of caching can also be set directly | |
514 in the response header. | |
515 This has higher priority than setting of caching time using the directive. | |
1349
97c8b146cb0e
Split the long paragraph about caching parameters into the list.
Ruslan Ermilov <ru@nginx.com>
parents:
1345
diff
changeset
|
516 <list type="bullet" compact="no"> |
97c8b146cb0e
Split the long paragraph about caching parameters into the list.
Ruslan Ermilov <ru@nginx.com>
parents:
1345
diff
changeset
|
517 |
97c8b146cb0e
Split the long paragraph about caching parameters into the list.
Ruslan Ermilov <ru@nginx.com>
parents:
1345
diff
changeset
|
518 <listitem> |
1180 | 519 The <header>X-Accel-Expires</header> header field sets caching time of a |
520 response in seconds. | |
521 The zero value disables caching for a response. | |
522 If the value starts with the <literal>@</literal> prefix, it sets an absolute | |
523 time in seconds since Epoch, up to which the response may be cached. | |
1349
97c8b146cb0e
Split the long paragraph about caching parameters into the list.
Ruslan Ermilov <ru@nginx.com>
parents:
1345
diff
changeset
|
524 </listitem> |
97c8b146cb0e
Split the long paragraph about caching parameters into the list.
Ruslan Ermilov <ru@nginx.com>
parents:
1345
diff
changeset
|
525 |
97c8b146cb0e
Split the long paragraph about caching parameters into the list.
Ruslan Ermilov <ru@nginx.com>
parents:
1345
diff
changeset
|
526 <listitem> |
1180 | 527 If the header does not include the <header>X-Accel-Expires</header> field, |
528 parameters of caching may be set in the header fields | |
529 <header>Expires</header> or <header>Cache-Control</header>. | |
1349
97c8b146cb0e
Split the long paragraph about caching parameters into the list.
Ruslan Ermilov <ru@nginx.com>
parents:
1345
diff
changeset
|
530 </listitem> |
97c8b146cb0e
Split the long paragraph about caching parameters into the list.
Ruslan Ermilov <ru@nginx.com>
parents:
1345
diff
changeset
|
531 |
97c8b146cb0e
Split the long paragraph about caching parameters into the list.
Ruslan Ermilov <ru@nginx.com>
parents:
1345
diff
changeset
|
532 <listitem> |
1180 | 533 If the header includes the <header>Set-Cookie</header> field, such a |
534 response will not be cached. | |
1349
97c8b146cb0e
Split the long paragraph about caching parameters into the list.
Ruslan Ermilov <ru@nginx.com>
parents:
1345
diff
changeset
|
535 </listitem> |
97c8b146cb0e
Split the long paragraph about caching parameters into the list.
Ruslan Ermilov <ru@nginx.com>
parents:
1345
diff
changeset
|
536 |
1353
25db29c8875e
Documented how the "Vary" response header field affects caching.
Ruslan Ermilov <ru@nginx.com>
parents:
1352
diff
changeset
|
537 <listitem> |
25db29c8875e
Documented how the "Vary" response header field affects caching.
Ruslan Ermilov <ru@nginx.com>
parents:
1352
diff
changeset
|
538 If the header includes the <header>Vary</header> field |
25db29c8875e
Documented how the "Vary" response header field affects caching.
Ruslan Ermilov <ru@nginx.com>
parents:
1352
diff
changeset
|
539 with the special value “<literal>*</literal>”, such a |
25db29c8875e
Documented how the "Vary" response header field affects caching.
Ruslan Ermilov <ru@nginx.com>
parents:
1352
diff
changeset
|
540 response will not be cached (1.7.7). |
25db29c8875e
Documented how the "Vary" response header field affects caching.
Ruslan Ermilov <ru@nginx.com>
parents:
1352
diff
changeset
|
541 If the header includes the <header>Vary</header> field |
25db29c8875e
Documented how the "Vary" response header field affects caching.
Ruslan Ermilov <ru@nginx.com>
parents:
1352
diff
changeset
|
542 with another value, such a response will be cached |
25db29c8875e
Documented how the "Vary" response header field affects caching.
Ruslan Ermilov <ru@nginx.com>
parents:
1352
diff
changeset
|
543 taking into account the corresponding request header fields (1.7.7). |
25db29c8875e
Documented how the "Vary" response header field affects caching.
Ruslan Ermilov <ru@nginx.com>
parents:
1352
diff
changeset
|
544 </listitem> |
25db29c8875e
Documented how the "Vary" response header field affects caching.
Ruslan Ermilov <ru@nginx.com>
parents:
1352
diff
changeset
|
545 |
1349
97c8b146cb0e
Split the long paragraph about caching parameters into the list.
Ruslan Ermilov <ru@nginx.com>
parents:
1345
diff
changeset
|
546 </list> |
1180 | 547 Processing of one or more of these response header fields can be disabled |
548 using the <link id="scgi_ignore_headers"/> directive. | |
549 </para> | |
550 | |
551 </directive> | |
552 | |
553 | |
554 <directive name="scgi_connect_timeout"> | |
555 <syntax><value>time</value></syntax> | |
556 <default>60s</default> | |
557 <context>http</context> | |
558 <context>server</context> | |
559 <context>location</context> | |
560 | |
561 <para> | |
562 Defines a timeout for establishing a connection with an SCGI server. | |
563 It should be noted that this timeout cannot usually exceed 75 seconds. | |
564 </para> | |
565 | |
566 </directive> | |
567 | |
568 | |
1337
91a064bdb4f9
Documented the "proxy_force_ranges" directive and friends.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1290
diff
changeset
|
569 <directive name="scgi_force_ranges"> |
91a064bdb4f9
Documented the "proxy_force_ranges" directive and friends.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1290
diff
changeset
|
570 <syntax><literal>on</literal> | <literal>off</literal></syntax> |
91a064bdb4f9
Documented the "proxy_force_ranges" directive and friends.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1290
diff
changeset
|
571 <default>off</default> |
91a064bdb4f9
Documented the "proxy_force_ranges" directive and friends.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1290
diff
changeset
|
572 <context>http</context> |
91a064bdb4f9
Documented the "proxy_force_ranges" directive and friends.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1290
diff
changeset
|
573 <context>server</context> |
91a064bdb4f9
Documented the "proxy_force_ranges" directive and friends.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1290
diff
changeset
|
574 <context>location</context> |
91a064bdb4f9
Documented the "proxy_force_ranges" directive and friends.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1290
diff
changeset
|
575 <appeared-in>1.7.7</appeared-in> |
91a064bdb4f9
Documented the "proxy_force_ranges" directive and friends.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1290
diff
changeset
|
576 |
91a064bdb4f9
Documented the "proxy_force_ranges" directive and friends.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1290
diff
changeset
|
577 <para> |
91a064bdb4f9
Documented the "proxy_force_ranges" directive and friends.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1290
diff
changeset
|
578 Enables byte-range support |
91a064bdb4f9
Documented the "proxy_force_ranges" directive and friends.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1290
diff
changeset
|
579 for both cached and uncached responses from the SCGI server |
91a064bdb4f9
Documented the "proxy_force_ranges" directive and friends.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1290
diff
changeset
|
580 regardless of the <header>Accept-Ranges</header> field in these responses. |
91a064bdb4f9
Documented the "proxy_force_ranges" directive and friends.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1290
diff
changeset
|
581 </para> |
91a064bdb4f9
Documented the "proxy_force_ranges" directive and friends.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1290
diff
changeset
|
582 |
91a064bdb4f9
Documented the "proxy_force_ranges" directive and friends.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1290
diff
changeset
|
583 </directive> |
91a064bdb4f9
Documented the "proxy_force_ranges" directive and friends.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1290
diff
changeset
|
584 |
91a064bdb4f9
Documented the "proxy_force_ranges" directive and friends.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1290
diff
changeset
|
585 |
1180 | 586 <directive name="scgi_hide_header"> |
587 <syntax><value>field</value></syntax> | |
588 <default/> | |
589 <context>http</context> | |
590 <context>server</context> | |
591 <context>location</context> | |
592 | |
593 <para> | |
594 By default, | |
595 nginx does not pass the header fields <header>Status</header> and | |
596 <header>X-Accel-...</header> from the response of an SCGI | |
597 server to a client. | |
598 The <literal>scgi_hide_header</literal> directive sets additional fields | |
599 that will not be passed. | |
600 If, on the contrary, the passing of fields needs to be permitted, | |
601 the <link id="scgi_pass_header"/> directive can be used. | |
602 </para> | |
603 | |
604 </directive> | |
605 | |
606 | |
607 <directive name="scgi_ignore_client_abort"> | |
608 <syntax><literal>on</literal> | <literal>off</literal></syntax> | |
609 <default>off</default> | |
610 <context>http</context> | |
611 <context>server</context> | |
612 <context>location</context> | |
613 | |
614 <para> | |
615 Determines whether the connection with an SCGI server should be | |
616 closed when a client closes the connection without waiting | |
617 for a response. | |
618 </para> | |
619 | |
620 </directive> | |
621 | |
622 | |
623 <directive name="scgi_ignore_headers"> | |
624 <syntax><value>field</value> ...</syntax> | |
625 <default/> | |
626 <context>http</context> | |
627 <context>server</context> | |
628 <context>location</context> | |
629 | |
630 <para> | |
631 Disables processing of certain response header fields from the SCGI server. | |
632 The following fields can be ignored: <header>X-Accel-Redirect</header>, | |
633 <header>X-Accel-Expires</header>, <header>X-Accel-Limit-Rate</header> (1.1.6), | |
634 <header>X-Accel-Buffering</header> (1.1.6), | |
635 <header>X-Accel-Charset</header> (1.1.6), <header>Expires</header>, | |
1345
da296387cdac
Documented the Vary support in proxy_ignore_headers and friends.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1343
diff
changeset
|
636 <header>Cache-Control</header>, <header>Set-Cookie</header> (0.8.44), |
da296387cdac
Documented the Vary support in proxy_ignore_headers and friends.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1343
diff
changeset
|
637 and <header>Vary</header> (1.7.7). |
1180 | 638 </para> |
639 | |
640 <para> | |
641 If not disabled, processing of these header fields has the following | |
642 effect: | |
643 <list type="bullet" compact="no"> | |
644 | |
645 <listitem> | |
646 <header>X-Accel-Expires</header>, <header>Expires</header>, | |
1345
da296387cdac
Documented the Vary support in proxy_ignore_headers and friends.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1343
diff
changeset
|
647 <header>Cache-Control</header>, <header>Set-Cookie</header>, |
da296387cdac
Documented the Vary support in proxy_ignore_headers and friends.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1343
diff
changeset
|
648 and <header>Vary</header> |
1180 | 649 set the parameters of response <link id="scgi_cache_valid">caching</link>; |
650 </listitem> | |
651 | |
652 <listitem> | |
653 <header>X-Accel-Redirect</header> performs an | |
654 <link doc="ngx_http_core_module.xml" id="internal">internal | |
655 redirect</link> to the specified URI; | |
656 </listitem> | |
657 | |
658 <listitem> | |
659 <header>X-Accel-Limit-Rate</header> sets the | |
660 <link doc="ngx_http_core_module.xml" id="limit_rate">rate | |
661 limit</link> for transmission of a response to a client; | |
662 </listitem> | |
663 | |
664 <listitem> | |
665 <header>X-Accel-Buffering</header> enables or disables | |
666 <link id="scgi_buffering">buffering</link> of a response; | |
667 </listitem> | |
668 | |
669 <listitem> | |
670 <header>X-Accel-Charset</header> sets the desired | |
671 <link doc="ngx_http_charset_module.xml" id="charset"/> | |
672 of a response. | |
673 </listitem> | |
674 | |
675 </list> | |
676 </para> | |
677 | |
678 </directive> | |
679 | |
680 | |
681 <directive name="scgi_intercept_errors"> | |
682 <syntax><literal>on</literal> | <literal>off</literal></syntax> | |
683 <default>off</default> | |
684 <context>http</context> | |
685 <context>server</context> | |
686 <context>location</context> | |
687 | |
688 <para> | |
689 Determines whether an SCGI server responses with codes greater than or equal | |
690 to 300 should be passed to a client or be redirected to nginx for processing | |
691 with the <link doc="ngx_http_core_module.xml" id="error_page"/> directive. | |
692 </para> | |
693 | |
694 </directive> | |
695 | |
696 | |
1342
758fc0b02651
Documented the "proxy_limit_rate" directive and friends.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1337
diff
changeset
|
697 <directive name="scgi_limit_rate"> |
758fc0b02651
Documented the "proxy_limit_rate" directive and friends.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1337
diff
changeset
|
698 <syntax><value>rate</value></syntax> |
758fc0b02651
Documented the "proxy_limit_rate" directive and friends.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1337
diff
changeset
|
699 <default>0</default> |
758fc0b02651
Documented the "proxy_limit_rate" directive and friends.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1337
diff
changeset
|
700 <context>http</context> |
758fc0b02651
Documented the "proxy_limit_rate" directive and friends.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1337
diff
changeset
|
701 <context>server</context> |
758fc0b02651
Documented the "proxy_limit_rate" directive and friends.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1337
diff
changeset
|
702 <context>location</context> |
758fc0b02651
Documented the "proxy_limit_rate" directive and friends.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1337
diff
changeset
|
703 <appeared-in>1.7.7</appeared-in> |
758fc0b02651
Documented the "proxy_limit_rate" directive and friends.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1337
diff
changeset
|
704 |
758fc0b02651
Documented the "proxy_limit_rate" directive and friends.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1337
diff
changeset
|
705 <para> |
758fc0b02651
Documented the "proxy_limit_rate" directive and friends.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1337
diff
changeset
|
706 Limits the speed of reading the response from the SCGI server. |
758fc0b02651
Documented the "proxy_limit_rate" directive and friends.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1337
diff
changeset
|
707 The <value>rate</value> is specified in bytes per second. |
758fc0b02651
Documented the "proxy_limit_rate" directive and friends.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1337
diff
changeset
|
708 The zero value disables rate limiting. |
758fc0b02651
Documented the "proxy_limit_rate" directive and friends.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1337
diff
changeset
|
709 The limit is set per a request, and so if nginx simultaneously opens |
1343
1bdde28e359b
Fixed fallouts from the previous change.
Ruslan Ermilov <ru@nginx.com>
parents:
1342
diff
changeset
|
710 two connections to the SCGI server, |
1bdde28e359b
Fixed fallouts from the previous change.
Ruslan Ermilov <ru@nginx.com>
parents:
1342
diff
changeset
|
711 the overall rate will be twice as much as the specified limit. |
1342
758fc0b02651
Documented the "proxy_limit_rate" directive and friends.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1337
diff
changeset
|
712 The limitation works only if |
758fc0b02651
Documented the "proxy_limit_rate" directive and friends.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1337
diff
changeset
|
713 <link id="scgi_buffering">buffering</link> of responses from the SCGI |
758fc0b02651
Documented the "proxy_limit_rate" directive and friends.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1337
diff
changeset
|
714 server is enabled. |
758fc0b02651
Documented the "proxy_limit_rate" directive and friends.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1337
diff
changeset
|
715 </para> |
758fc0b02651
Documented the "proxy_limit_rate" directive and friends.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1337
diff
changeset
|
716 |
758fc0b02651
Documented the "proxy_limit_rate" directive and friends.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1337
diff
changeset
|
717 </directive> |
758fc0b02651
Documented the "proxy_limit_rate" directive and friends.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1337
diff
changeset
|
718 |
758fc0b02651
Documented the "proxy_limit_rate" directive and friends.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1337
diff
changeset
|
719 |
1180 | 720 <directive name="scgi_max_temp_file_size"> |
721 <syntax><value>size</value></syntax> | |
722 <default>1024m</default> | |
723 <context>http</context> | |
724 <context>server</context> | |
725 <context>location</context> | |
726 | |
727 <para> | |
728 When <link id="scgi_buffering">buffering</link> of responses from the SCGI | |
729 server is enabled, and the whole response does not fit into the buffers | |
730 set by the <link id="scgi_buffer_size"/> and <link id="scgi_buffers"/> | |
731 directives, a part of the response can be saved to a temporary file. | |
732 This directive sets the maximum <value>size</value> of the temporary file. | |
733 The size of data written to the temporary file at a time is set | |
734 by the <link id="scgi_temp_file_write_size"/> directive. | |
735 </para> | |
736 | |
737 <para> | |
738 The zero value disables buffering of responses to temporary files. | |
739 </para> | |
740 | |
1352
dbb618f60a54
Elaborate on writing proxied responses to files.
Ruslan Ermilov <ru@nginx.com>
parents:
1349
diff
changeset
|
741 <para> |
dbb618f60a54
Elaborate on writing proxied responses to files.
Ruslan Ermilov <ru@nginx.com>
parents:
1349
diff
changeset
|
742 <note> |
dbb618f60a54
Elaborate on writing proxied responses to files.
Ruslan Ermilov <ru@nginx.com>
parents:
1349
diff
changeset
|
743 This restriction does not apply to responses |
dbb618f60a54
Elaborate on writing proxied responses to files.
Ruslan Ermilov <ru@nginx.com>
parents:
1349
diff
changeset
|
744 that will be <link id="scgi_cache">cached</link> |
dbb618f60a54
Elaborate on writing proxied responses to files.
Ruslan Ermilov <ru@nginx.com>
parents:
1349
diff
changeset
|
745 or <link id="scgi_store">stored</link> on disk. |
dbb618f60a54
Elaborate on writing proxied responses to files.
Ruslan Ermilov <ru@nginx.com>
parents:
1349
diff
changeset
|
746 </note> |
dbb618f60a54
Elaborate on writing proxied responses to files.
Ruslan Ermilov <ru@nginx.com>
parents:
1349
diff
changeset
|
747 </para> |
dbb618f60a54
Elaborate on writing proxied responses to files.
Ruslan Ermilov <ru@nginx.com>
parents:
1349
diff
changeset
|
748 |
1180 | 749 </directive> |
750 | |
751 | |
752 <directive name="scgi_next_upstream"> | |
753 <syntax> | |
754 <literal>error</literal> | | |
755 <literal>timeout</literal> | | |
756 <literal>invalid_header</literal> | | |
757 <literal>http_500</literal> | | |
758 <literal>http_503</literal> | | |
759 <literal>http_403</literal> | | |
760 <literal>http_404</literal> | | |
761 <literal>off</literal> | |
762 ...</syntax> | |
763 <default>error timeout</default> | |
764 <context>http</context> | |
765 <context>server</context> | |
766 <context>location</context> | |
767 | |
768 <para> | |
769 Specifies in which cases a request should be passed to the next server: | |
770 <list type="tag"> | |
771 | |
772 <tag-name><literal>error</literal></tag-name> | |
773 <tag-desc>an error occurred while establishing a connection with the | |
774 server, passing a request to it, or reading the response header;</tag-desc> | |
775 | |
776 <tag-name><literal>timeout</literal></tag-name> | |
777 <tag-desc>a timeout has occurred while establishing a connection with the | |
778 server, passing a request to it, or reading the response header;</tag-desc> | |
779 | |
780 <tag-name><literal>invalid_header</literal></tag-name> | |
781 <tag-desc>a server returned an empty or invalid response;</tag-desc> | |
782 | |
783 <tag-name><literal>http_500</literal></tag-name> | |
784 <tag-desc>a server returned a response with the code 500;</tag-desc> | |
785 | |
786 <tag-name><literal>http_503</literal></tag-name> | |
787 <tag-desc>a server returned a response with the code 503;</tag-desc> | |
788 | |
789 <tag-name><literal>http_403</literal></tag-name> | |
790 <tag-desc>a server returned a response with the code 403;</tag-desc> | |
791 | |
792 <tag-name><literal>http_404</literal></tag-name> | |
793 <tag-desc>a server returned a response with the code 404;</tag-desc> | |
794 | |
795 <tag-name><literal>off</literal></tag-name> | |
796 <tag-desc>disables passing a request to the next server.</tag-desc> | |
797 | |
798 </list> | |
799 </para> | |
800 | |
801 <para> | |
802 One should bear in mind that passing a request to the next server is | |
803 only possible if nothing has been sent to a client yet. | |
804 That is, if an error or timeout occurs in the middle of the | |
805 transferring of a response, fixing this is impossible. | |
806 </para> | |
807 | |
808 <para> | |
1289
57fc39924d42
Proxy/memcached/fastcgi/scgi/uwsgi: updated link in _next_upstream directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1246
diff
changeset
|
809 The directive also defines what is considered an |
57fc39924d42
Proxy/memcached/fastcgi/scgi/uwsgi: updated link in _next_upstream directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1246
diff
changeset
|
810 <link doc="ngx_http_upstream_module.xml" id="max_fails">unsuccessful |
57fc39924d42
Proxy/memcached/fastcgi/scgi/uwsgi: updated link in _next_upstream directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1246
diff
changeset
|
811 attempt</link> of communication with a server. |
1180 | 812 The cases of <literal>error</literal>, <literal>timeout</literal> and |
813 <literal>invalid_header</literal> are always considered unsuccessful attempts, | |
814 even if they are not specified in the directive. | |
815 The cases of <literal>http_500</literal> and <literal>http_503</literal> are | |
816 considered unsuccessful attempts only if they are specified in the directive. | |
817 The cases of <literal>http_403</literal> and <literal>http_404</literal> | |
818 are never considered unsuccessful attempts. | |
819 </para> | |
820 | |
1290
f5cc9f2aef9a
Proxy/memcached/fastcgi/scgi/uwsgi: _next_upstream_timeout,_next_upstream_tries.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1289
diff
changeset
|
821 <para> |
f5cc9f2aef9a
Proxy/memcached/fastcgi/scgi/uwsgi: _next_upstream_timeout,_next_upstream_tries.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1289
diff
changeset
|
822 Passing a request to the next server can be limited by |
f5cc9f2aef9a
Proxy/memcached/fastcgi/scgi/uwsgi: _next_upstream_timeout,_next_upstream_tries.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1289
diff
changeset
|
823 <link id="scgi_next_upstream_tries">the number of tries</link> |
f5cc9f2aef9a
Proxy/memcached/fastcgi/scgi/uwsgi: _next_upstream_timeout,_next_upstream_tries.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1289
diff
changeset
|
824 and by <link id="scgi_next_upstream_timeout">time</link>. |
f5cc9f2aef9a
Proxy/memcached/fastcgi/scgi/uwsgi: _next_upstream_timeout,_next_upstream_tries.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1289
diff
changeset
|
825 </para> |
f5cc9f2aef9a
Proxy/memcached/fastcgi/scgi/uwsgi: _next_upstream_timeout,_next_upstream_tries.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1289
diff
changeset
|
826 |
f5cc9f2aef9a
Proxy/memcached/fastcgi/scgi/uwsgi: _next_upstream_timeout,_next_upstream_tries.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1289
diff
changeset
|
827 </directive> |
f5cc9f2aef9a
Proxy/memcached/fastcgi/scgi/uwsgi: _next_upstream_timeout,_next_upstream_tries.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1289
diff
changeset
|
828 |
f5cc9f2aef9a
Proxy/memcached/fastcgi/scgi/uwsgi: _next_upstream_timeout,_next_upstream_tries.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1289
diff
changeset
|
829 |
f5cc9f2aef9a
Proxy/memcached/fastcgi/scgi/uwsgi: _next_upstream_timeout,_next_upstream_tries.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1289
diff
changeset
|
830 <directive name="scgi_next_upstream_timeout"> |
f5cc9f2aef9a
Proxy/memcached/fastcgi/scgi/uwsgi: _next_upstream_timeout,_next_upstream_tries.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1289
diff
changeset
|
831 <syntax><value>time</value></syntax> |
f5cc9f2aef9a
Proxy/memcached/fastcgi/scgi/uwsgi: _next_upstream_timeout,_next_upstream_tries.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1289
diff
changeset
|
832 <default>0</default> |
f5cc9f2aef9a
Proxy/memcached/fastcgi/scgi/uwsgi: _next_upstream_timeout,_next_upstream_tries.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1289
diff
changeset
|
833 <context>http</context> |
f5cc9f2aef9a
Proxy/memcached/fastcgi/scgi/uwsgi: _next_upstream_timeout,_next_upstream_tries.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1289
diff
changeset
|
834 <context>server</context> |
f5cc9f2aef9a
Proxy/memcached/fastcgi/scgi/uwsgi: _next_upstream_timeout,_next_upstream_tries.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1289
diff
changeset
|
835 <context>location</context> |
f5cc9f2aef9a
Proxy/memcached/fastcgi/scgi/uwsgi: _next_upstream_timeout,_next_upstream_tries.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1289
diff
changeset
|
836 <appeared-in>1.7.5</appeared-in> |
f5cc9f2aef9a
Proxy/memcached/fastcgi/scgi/uwsgi: _next_upstream_timeout,_next_upstream_tries.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1289
diff
changeset
|
837 |
f5cc9f2aef9a
Proxy/memcached/fastcgi/scgi/uwsgi: _next_upstream_timeout,_next_upstream_tries.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1289
diff
changeset
|
838 <para> |
f5cc9f2aef9a
Proxy/memcached/fastcgi/scgi/uwsgi: _next_upstream_timeout,_next_upstream_tries.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1289
diff
changeset
|
839 Limits the time allowed to pass a request to the |
f5cc9f2aef9a
Proxy/memcached/fastcgi/scgi/uwsgi: _next_upstream_timeout,_next_upstream_tries.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1289
diff
changeset
|
840 <link id="scgi_next_upstream">next server</link>. |
f5cc9f2aef9a
Proxy/memcached/fastcgi/scgi/uwsgi: _next_upstream_timeout,_next_upstream_tries.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1289
diff
changeset
|
841 The <literal>0</literal> value turns off this limitation. |
f5cc9f2aef9a
Proxy/memcached/fastcgi/scgi/uwsgi: _next_upstream_timeout,_next_upstream_tries.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1289
diff
changeset
|
842 </para> |
f5cc9f2aef9a
Proxy/memcached/fastcgi/scgi/uwsgi: _next_upstream_timeout,_next_upstream_tries.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1289
diff
changeset
|
843 |
f5cc9f2aef9a
Proxy/memcached/fastcgi/scgi/uwsgi: _next_upstream_timeout,_next_upstream_tries.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1289
diff
changeset
|
844 </directive> |
f5cc9f2aef9a
Proxy/memcached/fastcgi/scgi/uwsgi: _next_upstream_timeout,_next_upstream_tries.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1289
diff
changeset
|
845 |
f5cc9f2aef9a
Proxy/memcached/fastcgi/scgi/uwsgi: _next_upstream_timeout,_next_upstream_tries.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1289
diff
changeset
|
846 |
f5cc9f2aef9a
Proxy/memcached/fastcgi/scgi/uwsgi: _next_upstream_timeout,_next_upstream_tries.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1289
diff
changeset
|
847 <directive name="scgi_next_upstream_tries"> |
f5cc9f2aef9a
Proxy/memcached/fastcgi/scgi/uwsgi: _next_upstream_timeout,_next_upstream_tries.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1289
diff
changeset
|
848 <syntax><value>number</value></syntax> |
f5cc9f2aef9a
Proxy/memcached/fastcgi/scgi/uwsgi: _next_upstream_timeout,_next_upstream_tries.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1289
diff
changeset
|
849 <default>0</default> |
f5cc9f2aef9a
Proxy/memcached/fastcgi/scgi/uwsgi: _next_upstream_timeout,_next_upstream_tries.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1289
diff
changeset
|
850 <context>http</context> |
f5cc9f2aef9a
Proxy/memcached/fastcgi/scgi/uwsgi: _next_upstream_timeout,_next_upstream_tries.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1289
diff
changeset
|
851 <context>server</context> |
f5cc9f2aef9a
Proxy/memcached/fastcgi/scgi/uwsgi: _next_upstream_timeout,_next_upstream_tries.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1289
diff
changeset
|
852 <context>location</context> |
f5cc9f2aef9a
Proxy/memcached/fastcgi/scgi/uwsgi: _next_upstream_timeout,_next_upstream_tries.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1289
diff
changeset
|
853 <appeared-in>1.7.5</appeared-in> |
f5cc9f2aef9a
Proxy/memcached/fastcgi/scgi/uwsgi: _next_upstream_timeout,_next_upstream_tries.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1289
diff
changeset
|
854 |
f5cc9f2aef9a
Proxy/memcached/fastcgi/scgi/uwsgi: _next_upstream_timeout,_next_upstream_tries.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1289
diff
changeset
|
855 <para> |
f5cc9f2aef9a
Proxy/memcached/fastcgi/scgi/uwsgi: _next_upstream_timeout,_next_upstream_tries.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1289
diff
changeset
|
856 Limits the number of possible tries for passing a request to the |
f5cc9f2aef9a
Proxy/memcached/fastcgi/scgi/uwsgi: _next_upstream_timeout,_next_upstream_tries.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1289
diff
changeset
|
857 <link id="scgi_next_upstream">next server</link>. |
f5cc9f2aef9a
Proxy/memcached/fastcgi/scgi/uwsgi: _next_upstream_timeout,_next_upstream_tries.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1289
diff
changeset
|
858 The <literal>0</literal> value turns off this limitation. |
f5cc9f2aef9a
Proxy/memcached/fastcgi/scgi/uwsgi: _next_upstream_timeout,_next_upstream_tries.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1289
diff
changeset
|
859 </para> |
f5cc9f2aef9a
Proxy/memcached/fastcgi/scgi/uwsgi: _next_upstream_timeout,_next_upstream_tries.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1289
diff
changeset
|
860 |
1180 | 861 </directive> |
862 | |
863 | |
864 <directive name="scgi_no_cache"> | |
865 <syntax><value>string</value> ...</syntax> | |
866 <default/> | |
867 <context>http</context> | |
868 <context>server</context> | |
869 <context>location</context> | |
870 | |
871 <para> | |
872 Defines conditions under which the response will not be saved to a cache. | |
873 If at least one value of the string parameters is not empty and is not | |
874 equal to “0” then the response will not be saved: | |
875 <example> | |
876 scgi_no_cache $cookie_nocache $arg_nocache$arg_comment; | |
877 scgi_no_cache $http_pragma $http_authorization; | |
878 </example> | |
879 Can be used along with the <link id="scgi_cache_bypass"/> directive. | |
880 </para> | |
881 | |
882 </directive> | |
883 | |
884 | |
885 <directive name="scgi_param"> | |
886 <syntax> | |
887 <value>parameter</value> <value>value</value> | |
888 [<literal>if_not_empty</literal>]</syntax> | |
889 <default/> | |
890 <context>http</context> | |
891 <context>server</context> | |
892 <context>location</context> | |
893 | |
894 <para> | |
895 Sets a <value>parameter</value> that should be passed to the SCGI server. | |
896 The <value>value</value> can contain text, variables, and their combination. | |
897 These directives are inherited from the previous level if and | |
898 only if there are no | |
899 <literal>scgi_param</literal> | |
900 directives defined on the current level. | |
901 </para> | |
902 | |
903 <para> | |
904 Standard | |
905 <link url="http://tools.ietf.org/html/rfc3875#section-4.1">CGI | |
906 environment variables</link> | |
907 should be provided as SCGI headers, see the <path>scgi_params</path> file | |
908 provided in the distribution: | |
909 <example> | |
910 location / { | |
911 include scgi_params; | |
912 ... | |
913 } | |
914 </example> | |
915 </para> | |
916 | |
1182
ec1097156f81
Scgi: restored if_not_empty lost during conversion from fastcgi.
Ruslan Ermilov <ru@nginx.com>
parents:
1180
diff
changeset
|
917 <para> |
ec1097156f81
Scgi: restored if_not_empty lost during conversion from fastcgi.
Ruslan Ermilov <ru@nginx.com>
parents:
1180
diff
changeset
|
918 If a directive is specified with <literal>if_not_empty</literal> (1.1.11) then |
ec1097156f81
Scgi: restored if_not_empty lost during conversion from fastcgi.
Ruslan Ermilov <ru@nginx.com>
parents:
1180
diff
changeset
|
919 such a parameter will not be passed to the server until its value is not empty: |
ec1097156f81
Scgi: restored if_not_empty lost during conversion from fastcgi.
Ruslan Ermilov <ru@nginx.com>
parents:
1180
diff
changeset
|
920 <example> |
ec1097156f81
Scgi: restored if_not_empty lost during conversion from fastcgi.
Ruslan Ermilov <ru@nginx.com>
parents:
1180
diff
changeset
|
921 scgi_param HTTPS $https if_not_empty; |
ec1097156f81
Scgi: restored if_not_empty lost during conversion from fastcgi.
Ruslan Ermilov <ru@nginx.com>
parents:
1180
diff
changeset
|
922 </example> |
ec1097156f81
Scgi: restored if_not_empty lost during conversion from fastcgi.
Ruslan Ermilov <ru@nginx.com>
parents:
1180
diff
changeset
|
923 </para> |
ec1097156f81
Scgi: restored if_not_empty lost during conversion from fastcgi.
Ruslan Ermilov <ru@nginx.com>
parents:
1180
diff
changeset
|
924 |
1180 | 925 </directive> |
926 | |
927 | |
928 <directive name="scgi_pass"> | |
929 <syntax><value>address</value></syntax> | |
930 <default/> | |
931 <context>location</context> | |
932 <context>if in location</context> | |
933 | |
934 <para> | |
935 Sets the address of an SCGI server. | |
936 The address can be specified as a domain name or IP address, | |
937 and an optional port: | |
938 <example> | |
939 scgi_pass localhost:9000; | |
940 </example> | |
941 or as a UNIX-domain socket path: | |
942 <example> | |
943 scgi_pass unix:/tmp/scgi.socket; | |
944 </example> | |
945 </para> | |
946 | |
947 <para> | |
948 If a domain name resolves to several addresses, all of them will be | |
949 used in a round-robin fashion. | |
950 In addition, an address can be specified as a | |
951 <link doc="ngx_http_upstream_module.xml">server group</link>. | |
952 </para> | |
953 | |
954 </directive> | |
955 | |
956 | |
957 <directive name="scgi_pass_header"> | |
958 <syntax><value>field</value></syntax> | |
959 <default/> | |
960 <context>http</context> | |
961 <context>server</context> | |
962 <context>location</context> | |
963 | |
964 <para> | |
965 Permits passing <link id="scgi_hide_header">otherwise disabled</link> header | |
966 fields from an SCGI server to a client. | |
967 </para> | |
968 | |
969 </directive> | |
970 | |
971 | |
972 <directive name="scgi_read_timeout"> | |
973 <syntax><value>time</value></syntax> | |
974 <default>60s</default> | |
975 <context>http</context> | |
976 <context>server</context> | |
977 <context>location</context> | |
978 | |
979 <para> | |
980 Defines a timeout for reading a response from the SCGI server. | |
981 The timeout is set only between two successive read operations, | |
982 not for the transmission of the whole response. | |
983 If the SCGI server does not transmit anything within this time, | |
984 the connection is closed. | |
985 </para> | |
986 | |
987 </directive> | |
988 | |
989 | |
990 <directive name="scgi_pass_request_body"> | |
991 <syntax><literal>on</literal> | <literal>off</literal></syntax> | |
992 <default>on</default> | |
993 <context>http</context> | |
994 <context>server</context> | |
995 <context>location</context> | |
996 | |
997 <para> | |
998 Indicates whether the original request body is passed | |
999 to the SCGI server. | |
1000 See also the <link id="scgi_pass_request_headers"/> directive. | |
1001 </para> | |
1002 | |
1003 </directive> | |
1004 | |
1005 | |
1006 <directive name="scgi_pass_request_headers"> | |
1007 <syntax><literal>on</literal> | <literal>off</literal></syntax> | |
1008 <default>on</default> | |
1009 <context>http</context> | |
1010 <context>server</context> | |
1011 <context>location</context> | |
1012 | |
1013 <para> | |
1014 Indicates whether the header fields of the original request are passed | |
1015 to the SCGI server. | |
1016 See also the <link id="scgi_pass_request_body"/> directive. | |
1017 </para> | |
1018 | |
1019 </directive> | |
1020 | |
1021 | |
1022 <directive name="scgi_send_timeout"> | |
1023 <syntax><value>time</value></syntax> | |
1024 <default>60s</default> | |
1025 <context>http</context> | |
1026 <context>server</context> | |
1027 <context>location</context> | |
1028 | |
1029 <para> | |
1030 Sets a timeout for transmitting a request to the SCGI server. | |
1031 The timeout is set only between two successive write operations, | |
1032 not for the transmission of the whole request. | |
1033 If the SCGI server does not receive anything within this time, | |
1034 the connection is closed. | |
1035 </para> | |
1036 | |
1037 </directive> | |
1038 | |
1039 | |
1040 <directive name="scgi_store"> | |
1041 <syntax> | |
1042 <literal>on</literal> | | |
1043 <literal>off</literal> | | |
1044 <value>string</value></syntax> | |
1045 <default>off</default> | |
1046 <context>http</context> | |
1047 <context>server</context> | |
1048 <context>location</context> | |
1049 | |
1050 <para> | |
1051 Enables saving of files to a disk. | |
1052 The <literal>on</literal> parameter saves files with paths | |
1053 corresponding to the directives | |
1054 <link doc="ngx_http_core_module.xml" id="alias"/> or | |
1055 <link doc="ngx_http_core_module.xml" id="root"/>. | |
1056 The <literal>off</literal> parameter disables saving of files. | |
1057 In addition, the file name can be set explicitly using the | |
1058 <value>string</value> with variables: | |
1059 <example> | |
1060 scgi_store /data/www$original_uri; | |
1061 </example> | |
1062 </para> | |
1063 | |
1064 <para> | |
1065 The modification time of files is set according to the received | |
1066 <header>Last-Modified</header> response header field. | |
1067 The response is first written to a temporary file, | |
1068 and then the file is renamed. | |
1069 Starting from version 0.8.9, temporary files and the persistent store | |
1070 can be put on different file systems. | |
1071 However, be aware that in this case a file is copied | |
1072 across two file systems instead of the cheap renaming operation. | |
1073 It is thus recommended that for any given location both saved files and a | |
1074 directory holding temporary files, set by the <link id="scgi_temp_path"/> | |
1075 directive, are put on the same file system. | |
1076 </para> | |
1077 | |
1078 <para> | |
1079 This directive can be used to create local copies of static unchangeable | |
1080 files, e.g.: | |
1081 <example> | |
1082 location /images/ { | |
1184
55857cbf562d
Fixed alignment issues after mechanical conversion from fastcgi.
Ruslan Ermilov <ru@nginx.com>
parents:
1182
diff
changeset
|
1083 root /data/www; |
55857cbf562d
Fixed alignment issues after mechanical conversion from fastcgi.
Ruslan Ermilov <ru@nginx.com>
parents:
1182
diff
changeset
|
1084 error_page 404 = /fetch$uri; |
1180 | 1085 } |
1086 | |
1087 location /fetch/ { | |
1088 internal; | |
1089 | |
1090 scgi_pass backend:9000; | |
1091 ... | |
1092 | |
1093 scgi_store on; | |
1094 scgi_store_access user:rw group:rw all:r; | |
1095 scgi_temp_path /data/temp; | |
1096 | |
1184
55857cbf562d
Fixed alignment issues after mechanical conversion from fastcgi.
Ruslan Ermilov <ru@nginx.com>
parents:
1182
diff
changeset
|
1097 alias /data/www/; |
1180 | 1098 } |
1099 </example> | |
1100 </para> | |
1101 | |
1102 </directive> | |
1103 | |
1104 | |
1105 <directive name="scgi_store_access"> | |
1106 <syntax><value>users</value>:<value>permissions</value> ...</syntax> | |
1107 <default>user:rw</default> | |
1108 <context>http</context> | |
1109 <context>server</context> | |
1110 <context>location</context> | |
1111 | |
1112 <para> | |
1113 Sets access permissions for newly created files and directories, e.g.: | |
1114 <example> | |
1115 scgi_store_access user:rw group:rw all:r; | |
1116 </example> | |
1117 </para> | |
1118 | |
1119 <para> | |
1120 If any <literal>group</literal> or <literal>all</literal> access permissions | |
1121 are specified then <literal>user</literal> permissions may be omitted: | |
1122 <example> | |
1123 scgi_store_access group:rw all:r; | |
1124 </example> | |
1125 </para> | |
1126 | |
1127 </directive> | |
1128 | |
1129 | |
1130 <directive name="scgi_temp_file_write_size"> | |
1131 <syntax><value>size</value></syntax> | |
1132 <default>8k|16k</default> | |
1133 <context>http</context> | |
1134 <context>server</context> | |
1135 <context>location</context> | |
1136 | |
1137 <para> | |
1138 Limits the <value>size</value> of data written to a temporary file | |
1139 at a time, when buffering of responses from the SCGI server | |
1140 to temporary files is enabled. | |
1141 By default, <value>size</value> is limited by two buffers set by the | |
1142 <link id="scgi_buffer_size"/> and <link id="scgi_buffers"/> directives. | |
1143 The maximum size of a temporary file is set by the | |
1144 <link id="scgi_max_temp_file_size"/> directive. | |
1145 </para> | |
1146 | |
1147 </directive> | |
1148 | |
1149 | |
1150 <directive name="scgi_temp_path"> | |
1151 <syntax> | |
1152 <value>path</value> | |
1153 [<value>level1</value> | |
1154 [<value>level2</value> | |
1155 [<value>level3</value>]]]</syntax> | |
1156 <default>scgi_temp</default> | |
1157 <context>http</context> | |
1158 <context>server</context> | |
1159 <context>location</context> | |
1160 | |
1161 <para> | |
1162 Defines a directory for storing temporary files | |
1163 with data received from SCGI servers. | |
1164 Up to three-level subdirectory hierarchy can be used underneath the specified | |
1165 directory. | |
1166 For example, in the following configuration | |
1167 <example> | |
1168 scgi_temp_path /spool/nginx/scgi_temp 1 2; | |
1169 </example> | |
1170 a temporary file might look like this: | |
1171 <example> | |
1172 /spool/nginx/scgi_temp/<emphasis>7</emphasis>/<emphasis>45</emphasis>/00000123<emphasis>457</emphasis> | |
1173 </example> | |
1174 </para> | |
1175 | |
1176 </directive> | |
1177 | |
1178 </section> | |
1179 | |
1180 </module> |