Mercurial > hg > nginx-site
annotate xml/en/docs/http/ngx_http_scgi_module.xml @ 1349:97c8b146cb0e
Split the long paragraph about caching parameters into the list.
author | Ruslan Ermilov <ru@nginx.com> |
---|---|
date | Thu, 30 Oct 2014 20:26:47 +0300 |
parents | da296387cdac |
children | dbb618f60a54 |
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" | |
1345
da296387cdac
Documented the Vary support in proxy_ignore_headers and friends.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1343
diff
changeset
|
13 rev="10"> |
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 |
97c8b146cb0e
Split the long paragraph about caching parameters into the list.
Ruslan Ermilov <ru@nginx.com>
parents:
1345
diff
changeset
|
537 </list> |
1180 | 538 Processing of one or more of these response header fields can be disabled |
539 using the <link id="scgi_ignore_headers"/> directive. | |
540 </para> | |
541 | |
542 </directive> | |
543 | |
544 | |
545 <directive name="scgi_connect_timeout"> | |
546 <syntax><value>time</value></syntax> | |
547 <default>60s</default> | |
548 <context>http</context> | |
549 <context>server</context> | |
550 <context>location</context> | |
551 | |
552 <para> | |
553 Defines a timeout for establishing a connection with an SCGI server. | |
554 It should be noted that this timeout cannot usually exceed 75 seconds. | |
555 </para> | |
556 | |
557 </directive> | |
558 | |
559 | |
1337
91a064bdb4f9
Documented the "proxy_force_ranges" directive and friends.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1290
diff
changeset
|
560 <directive name="scgi_force_ranges"> |
91a064bdb4f9
Documented the "proxy_force_ranges" directive and friends.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1290
diff
changeset
|
561 <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
|
562 <default>off</default> |
91a064bdb4f9
Documented the "proxy_force_ranges" directive and friends.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1290
diff
changeset
|
563 <context>http</context> |
91a064bdb4f9
Documented the "proxy_force_ranges" directive and friends.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1290
diff
changeset
|
564 <context>server</context> |
91a064bdb4f9
Documented the "proxy_force_ranges" directive and friends.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1290
diff
changeset
|
565 <context>location</context> |
91a064bdb4f9
Documented the "proxy_force_ranges" directive and friends.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1290
diff
changeset
|
566 <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
|
567 |
91a064bdb4f9
Documented the "proxy_force_ranges" directive and friends.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1290
diff
changeset
|
568 <para> |
91a064bdb4f9
Documented the "proxy_force_ranges" directive and friends.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1290
diff
changeset
|
569 Enables byte-range support |
91a064bdb4f9
Documented the "proxy_force_ranges" directive and friends.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1290
diff
changeset
|
570 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
|
571 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
|
572 </para> |
91a064bdb4f9
Documented the "proxy_force_ranges" directive and friends.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1290
diff
changeset
|
573 |
91a064bdb4f9
Documented the "proxy_force_ranges" directive and friends.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1290
diff
changeset
|
574 </directive> |
91a064bdb4f9
Documented the "proxy_force_ranges" directive and friends.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1290
diff
changeset
|
575 |
91a064bdb4f9
Documented the "proxy_force_ranges" directive and friends.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1290
diff
changeset
|
576 |
1180 | 577 <directive name="scgi_hide_header"> |
578 <syntax><value>field</value></syntax> | |
579 <default/> | |
580 <context>http</context> | |
581 <context>server</context> | |
582 <context>location</context> | |
583 | |
584 <para> | |
585 By default, | |
586 nginx does not pass the header fields <header>Status</header> and | |
587 <header>X-Accel-...</header> from the response of an SCGI | |
588 server to a client. | |
589 The <literal>scgi_hide_header</literal> directive sets additional fields | |
590 that will not be passed. | |
591 If, on the contrary, the passing of fields needs to be permitted, | |
592 the <link id="scgi_pass_header"/> directive can be used. | |
593 </para> | |
594 | |
595 </directive> | |
596 | |
597 | |
598 <directive name="scgi_ignore_client_abort"> | |
599 <syntax><literal>on</literal> | <literal>off</literal></syntax> | |
600 <default>off</default> | |
601 <context>http</context> | |
602 <context>server</context> | |
603 <context>location</context> | |
604 | |
605 <para> | |
606 Determines whether the connection with an SCGI server should be | |
607 closed when a client closes the connection without waiting | |
608 for a response. | |
609 </para> | |
610 | |
611 </directive> | |
612 | |
613 | |
614 <directive name="scgi_ignore_headers"> | |
615 <syntax><value>field</value> ...</syntax> | |
616 <default/> | |
617 <context>http</context> | |
618 <context>server</context> | |
619 <context>location</context> | |
620 | |
621 <para> | |
622 Disables processing of certain response header fields from the SCGI server. | |
623 The following fields can be ignored: <header>X-Accel-Redirect</header>, | |
624 <header>X-Accel-Expires</header>, <header>X-Accel-Limit-Rate</header> (1.1.6), | |
625 <header>X-Accel-Buffering</header> (1.1.6), | |
626 <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
|
627 <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
|
628 and <header>Vary</header> (1.7.7). |
1180 | 629 </para> |
630 | |
631 <para> | |
632 If not disabled, processing of these header fields has the following | |
633 effect: | |
634 <list type="bullet" compact="no"> | |
635 | |
636 <listitem> | |
637 <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
|
638 <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
|
639 and <header>Vary</header> |
1180 | 640 set the parameters of response <link id="scgi_cache_valid">caching</link>; |
641 </listitem> | |
642 | |
643 <listitem> | |
644 <header>X-Accel-Redirect</header> performs an | |
645 <link doc="ngx_http_core_module.xml" id="internal">internal | |
646 redirect</link> to the specified URI; | |
647 </listitem> | |
648 | |
649 <listitem> | |
650 <header>X-Accel-Limit-Rate</header> sets the | |
651 <link doc="ngx_http_core_module.xml" id="limit_rate">rate | |
652 limit</link> for transmission of a response to a client; | |
653 </listitem> | |
654 | |
655 <listitem> | |
656 <header>X-Accel-Buffering</header> enables or disables | |
657 <link id="scgi_buffering">buffering</link> of a response; | |
658 </listitem> | |
659 | |
660 <listitem> | |
661 <header>X-Accel-Charset</header> sets the desired | |
662 <link doc="ngx_http_charset_module.xml" id="charset"/> | |
663 of a response. | |
664 </listitem> | |
665 | |
666 </list> | |
667 </para> | |
668 | |
669 </directive> | |
670 | |
671 | |
672 <directive name="scgi_intercept_errors"> | |
673 <syntax><literal>on</literal> | <literal>off</literal></syntax> | |
674 <default>off</default> | |
675 <context>http</context> | |
676 <context>server</context> | |
677 <context>location</context> | |
678 | |
679 <para> | |
680 Determines whether an SCGI server responses with codes greater than or equal | |
681 to 300 should be passed to a client or be redirected to nginx for processing | |
682 with the <link doc="ngx_http_core_module.xml" id="error_page"/> directive. | |
683 </para> | |
684 | |
685 </directive> | |
686 | |
687 | |
1342
758fc0b02651
Documented the "proxy_limit_rate" directive and friends.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1337
diff
changeset
|
688 <directive name="scgi_limit_rate"> |
758fc0b02651
Documented the "proxy_limit_rate" directive and friends.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1337
diff
changeset
|
689 <syntax><value>rate</value></syntax> |
758fc0b02651
Documented the "proxy_limit_rate" directive and friends.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1337
diff
changeset
|
690 <default>0</default> |
758fc0b02651
Documented the "proxy_limit_rate" directive and friends.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1337
diff
changeset
|
691 <context>http</context> |
758fc0b02651
Documented the "proxy_limit_rate" directive and friends.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1337
diff
changeset
|
692 <context>server</context> |
758fc0b02651
Documented the "proxy_limit_rate" directive and friends.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1337
diff
changeset
|
693 <context>location</context> |
758fc0b02651
Documented the "proxy_limit_rate" directive and friends.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1337
diff
changeset
|
694 <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
|
695 |
758fc0b02651
Documented the "proxy_limit_rate" directive and friends.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1337
diff
changeset
|
696 <para> |
758fc0b02651
Documented the "proxy_limit_rate" directive and friends.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1337
diff
changeset
|
697 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
|
698 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
|
699 The zero value disables rate limiting. |
758fc0b02651
Documented the "proxy_limit_rate" directive and friends.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1337
diff
changeset
|
700 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
|
701 two connections to the SCGI server, |
1bdde28e359b
Fixed fallouts from the previous change.
Ruslan Ermilov <ru@nginx.com>
parents:
1342
diff
changeset
|
702 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
|
703 The limitation works only if |
758fc0b02651
Documented the "proxy_limit_rate" directive and friends.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1337
diff
changeset
|
704 <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
|
705 server is enabled. |
758fc0b02651
Documented the "proxy_limit_rate" directive and friends.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1337
diff
changeset
|
706 </para> |
758fc0b02651
Documented the "proxy_limit_rate" directive and friends.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1337
diff
changeset
|
707 |
758fc0b02651
Documented the "proxy_limit_rate" directive and friends.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1337
diff
changeset
|
708 </directive> |
758fc0b02651
Documented the "proxy_limit_rate" directive and friends.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1337
diff
changeset
|
709 |
758fc0b02651
Documented the "proxy_limit_rate" directive and friends.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1337
diff
changeset
|
710 |
1180 | 711 <directive name="scgi_max_temp_file_size"> |
712 <syntax><value>size</value></syntax> | |
713 <default>1024m</default> | |
714 <context>http</context> | |
715 <context>server</context> | |
716 <context>location</context> | |
717 | |
718 <para> | |
719 When <link id="scgi_buffering">buffering</link> of responses from the SCGI | |
720 server is enabled, and the whole response does not fit into the buffers | |
721 set by the <link id="scgi_buffer_size"/> and <link id="scgi_buffers"/> | |
722 directives, a part of the response can be saved to a temporary file. | |
723 This directive sets the maximum <value>size</value> of the temporary file. | |
724 The size of data written to the temporary file at a time is set | |
725 by the <link id="scgi_temp_file_write_size"/> directive. | |
726 </para> | |
727 | |
728 <para> | |
729 The zero value disables buffering of responses to temporary files. | |
730 </para> | |
731 | |
732 </directive> | |
733 | |
734 | |
735 <directive name="scgi_next_upstream"> | |
736 <syntax> | |
737 <literal>error</literal> | | |
738 <literal>timeout</literal> | | |
739 <literal>invalid_header</literal> | | |
740 <literal>http_500</literal> | | |
741 <literal>http_503</literal> | | |
742 <literal>http_403</literal> | | |
743 <literal>http_404</literal> | | |
744 <literal>off</literal> | |
745 ...</syntax> | |
746 <default>error timeout</default> | |
747 <context>http</context> | |
748 <context>server</context> | |
749 <context>location</context> | |
750 | |
751 <para> | |
752 Specifies in which cases a request should be passed to the next server: | |
753 <list type="tag"> | |
754 | |
755 <tag-name><literal>error</literal></tag-name> | |
756 <tag-desc>an error occurred while establishing a connection with the | |
757 server, passing a request to it, or reading the response header;</tag-desc> | |
758 | |
759 <tag-name><literal>timeout</literal></tag-name> | |
760 <tag-desc>a timeout has occurred while establishing a connection with the | |
761 server, passing a request to it, or reading the response header;</tag-desc> | |
762 | |
763 <tag-name><literal>invalid_header</literal></tag-name> | |
764 <tag-desc>a server returned an empty or invalid response;</tag-desc> | |
765 | |
766 <tag-name><literal>http_500</literal></tag-name> | |
767 <tag-desc>a server returned a response with the code 500;</tag-desc> | |
768 | |
769 <tag-name><literal>http_503</literal></tag-name> | |
770 <tag-desc>a server returned a response with the code 503;</tag-desc> | |
771 | |
772 <tag-name><literal>http_403</literal></tag-name> | |
773 <tag-desc>a server returned a response with the code 403;</tag-desc> | |
774 | |
775 <tag-name><literal>http_404</literal></tag-name> | |
776 <tag-desc>a server returned a response with the code 404;</tag-desc> | |
777 | |
778 <tag-name><literal>off</literal></tag-name> | |
779 <tag-desc>disables passing a request to the next server.</tag-desc> | |
780 | |
781 </list> | |
782 </para> | |
783 | |
784 <para> | |
785 One should bear in mind that passing a request to the next server is | |
786 only possible if nothing has been sent to a client yet. | |
787 That is, if an error or timeout occurs in the middle of the | |
788 transferring of a response, fixing this is impossible. | |
789 </para> | |
790 | |
791 <para> | |
1289
57fc39924d42
Proxy/memcached/fastcgi/scgi/uwsgi: updated link in _next_upstream directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1246
diff
changeset
|
792 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
|
793 <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
|
794 attempt</link> of communication with a server. |
1180 | 795 The cases of <literal>error</literal>, <literal>timeout</literal> and |
796 <literal>invalid_header</literal> are always considered unsuccessful attempts, | |
797 even if they are not specified in the directive. | |
798 The cases of <literal>http_500</literal> and <literal>http_503</literal> are | |
799 considered unsuccessful attempts only if they are specified in the directive. | |
800 The cases of <literal>http_403</literal> and <literal>http_404</literal> | |
801 are never considered unsuccessful attempts. | |
802 </para> | |
803 | |
1290
f5cc9f2aef9a
Proxy/memcached/fastcgi/scgi/uwsgi: _next_upstream_timeout,_next_upstream_tries.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1289
diff
changeset
|
804 <para> |
f5cc9f2aef9a
Proxy/memcached/fastcgi/scgi/uwsgi: _next_upstream_timeout,_next_upstream_tries.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1289
diff
changeset
|
805 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
|
806 <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
|
807 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
|
808 </para> |
f5cc9f2aef9a
Proxy/memcached/fastcgi/scgi/uwsgi: _next_upstream_timeout,_next_upstream_tries.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1289
diff
changeset
|
809 |
f5cc9f2aef9a
Proxy/memcached/fastcgi/scgi/uwsgi: _next_upstream_timeout,_next_upstream_tries.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1289
diff
changeset
|
810 </directive> |
f5cc9f2aef9a
Proxy/memcached/fastcgi/scgi/uwsgi: _next_upstream_timeout,_next_upstream_tries.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1289
diff
changeset
|
811 |
f5cc9f2aef9a
Proxy/memcached/fastcgi/scgi/uwsgi: _next_upstream_timeout,_next_upstream_tries.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1289
diff
changeset
|
812 |
f5cc9f2aef9a
Proxy/memcached/fastcgi/scgi/uwsgi: _next_upstream_timeout,_next_upstream_tries.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1289
diff
changeset
|
813 <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
|
814 <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
|
815 <default>0</default> |
f5cc9f2aef9a
Proxy/memcached/fastcgi/scgi/uwsgi: _next_upstream_timeout,_next_upstream_tries.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1289
diff
changeset
|
816 <context>http</context> |
f5cc9f2aef9a
Proxy/memcached/fastcgi/scgi/uwsgi: _next_upstream_timeout,_next_upstream_tries.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1289
diff
changeset
|
817 <context>server</context> |
f5cc9f2aef9a
Proxy/memcached/fastcgi/scgi/uwsgi: _next_upstream_timeout,_next_upstream_tries.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1289
diff
changeset
|
818 <context>location</context> |
f5cc9f2aef9a
Proxy/memcached/fastcgi/scgi/uwsgi: _next_upstream_timeout,_next_upstream_tries.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1289
diff
changeset
|
819 <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
|
820 |
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 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
|
823 <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
|
824 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
|
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_tries"> |
f5cc9f2aef9a
Proxy/memcached/fastcgi/scgi/uwsgi: _next_upstream_timeout,_next_upstream_tries.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1289
diff
changeset
|
831 <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
|
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 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
|
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 |
1180 | 844 </directive> |
845 | |
846 | |
847 <directive name="scgi_no_cache"> | |
848 <syntax><value>string</value> ...</syntax> | |
849 <default/> | |
850 <context>http</context> | |
851 <context>server</context> | |
852 <context>location</context> | |
853 | |
854 <para> | |
855 Defines conditions under which the response will not be saved to a cache. | |
856 If at least one value of the string parameters is not empty and is not | |
857 equal to “0” then the response will not be saved: | |
858 <example> | |
859 scgi_no_cache $cookie_nocache $arg_nocache$arg_comment; | |
860 scgi_no_cache $http_pragma $http_authorization; | |
861 </example> | |
862 Can be used along with the <link id="scgi_cache_bypass"/> directive. | |
863 </para> | |
864 | |
865 </directive> | |
866 | |
867 | |
868 <directive name="scgi_param"> | |
869 <syntax> | |
870 <value>parameter</value> <value>value</value> | |
871 [<literal>if_not_empty</literal>]</syntax> | |
872 <default/> | |
873 <context>http</context> | |
874 <context>server</context> | |
875 <context>location</context> | |
876 | |
877 <para> | |
878 Sets a <value>parameter</value> that should be passed to the SCGI server. | |
879 The <value>value</value> can contain text, variables, and their combination. | |
880 These directives are inherited from the previous level if and | |
881 only if there are no | |
882 <literal>scgi_param</literal> | |
883 directives defined on the current level. | |
884 </para> | |
885 | |
886 <para> | |
887 Standard | |
888 <link url="http://tools.ietf.org/html/rfc3875#section-4.1">CGI | |
889 environment variables</link> | |
890 should be provided as SCGI headers, see the <path>scgi_params</path> file | |
891 provided in the distribution: | |
892 <example> | |
893 location / { | |
894 include scgi_params; | |
895 ... | |
896 } | |
897 </example> | |
898 </para> | |
899 | |
1182
ec1097156f81
Scgi: restored if_not_empty lost during conversion from fastcgi.
Ruslan Ermilov <ru@nginx.com>
parents:
1180
diff
changeset
|
900 <para> |
ec1097156f81
Scgi: restored if_not_empty lost during conversion from fastcgi.
Ruslan Ermilov <ru@nginx.com>
parents:
1180
diff
changeset
|
901 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
|
902 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
|
903 <example> |
ec1097156f81
Scgi: restored if_not_empty lost during conversion from fastcgi.
Ruslan Ermilov <ru@nginx.com>
parents:
1180
diff
changeset
|
904 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
|
905 </example> |
ec1097156f81
Scgi: restored if_not_empty lost during conversion from fastcgi.
Ruslan Ermilov <ru@nginx.com>
parents:
1180
diff
changeset
|
906 </para> |
ec1097156f81
Scgi: restored if_not_empty lost during conversion from fastcgi.
Ruslan Ermilov <ru@nginx.com>
parents:
1180
diff
changeset
|
907 |
1180 | 908 </directive> |
909 | |
910 | |
911 <directive name="scgi_pass"> | |
912 <syntax><value>address</value></syntax> | |
913 <default/> | |
914 <context>location</context> | |
915 <context>if in location</context> | |
916 | |
917 <para> | |
918 Sets the address of an SCGI server. | |
919 The address can be specified as a domain name or IP address, | |
920 and an optional port: | |
921 <example> | |
922 scgi_pass localhost:9000; | |
923 </example> | |
924 or as a UNIX-domain socket path: | |
925 <example> | |
926 scgi_pass unix:/tmp/scgi.socket; | |
927 </example> | |
928 </para> | |
929 | |
930 <para> | |
931 If a domain name resolves to several addresses, all of them will be | |
932 used in a round-robin fashion. | |
933 In addition, an address can be specified as a | |
934 <link doc="ngx_http_upstream_module.xml">server group</link>. | |
935 </para> | |
936 | |
937 </directive> | |
938 | |
939 | |
940 <directive name="scgi_pass_header"> | |
941 <syntax><value>field</value></syntax> | |
942 <default/> | |
943 <context>http</context> | |
944 <context>server</context> | |
945 <context>location</context> | |
946 | |
947 <para> | |
948 Permits passing <link id="scgi_hide_header">otherwise disabled</link> header | |
949 fields from an SCGI server to a client. | |
950 </para> | |
951 | |
952 </directive> | |
953 | |
954 | |
955 <directive name="scgi_read_timeout"> | |
956 <syntax><value>time</value></syntax> | |
957 <default>60s</default> | |
958 <context>http</context> | |
959 <context>server</context> | |
960 <context>location</context> | |
961 | |
962 <para> | |
963 Defines a timeout for reading a response from the SCGI server. | |
964 The timeout is set only between two successive read operations, | |
965 not for the transmission of the whole response. | |
966 If the SCGI server does not transmit anything within this time, | |
967 the connection is closed. | |
968 </para> | |
969 | |
970 </directive> | |
971 | |
972 | |
973 <directive name="scgi_pass_request_body"> | |
974 <syntax><literal>on</literal> | <literal>off</literal></syntax> | |
975 <default>on</default> | |
976 <context>http</context> | |
977 <context>server</context> | |
978 <context>location</context> | |
979 | |
980 <para> | |
981 Indicates whether the original request body is passed | |
982 to the SCGI server. | |
983 See also the <link id="scgi_pass_request_headers"/> directive. | |
984 </para> | |
985 | |
986 </directive> | |
987 | |
988 | |
989 <directive name="scgi_pass_request_headers"> | |
990 <syntax><literal>on</literal> | <literal>off</literal></syntax> | |
991 <default>on</default> | |
992 <context>http</context> | |
993 <context>server</context> | |
994 <context>location</context> | |
995 | |
996 <para> | |
997 Indicates whether the header fields of the original request are passed | |
998 to the SCGI server. | |
999 See also the <link id="scgi_pass_request_body"/> directive. | |
1000 </para> | |
1001 | |
1002 </directive> | |
1003 | |
1004 | |
1005 <directive name="scgi_send_timeout"> | |
1006 <syntax><value>time</value></syntax> | |
1007 <default>60s</default> | |
1008 <context>http</context> | |
1009 <context>server</context> | |
1010 <context>location</context> | |
1011 | |
1012 <para> | |
1013 Sets a timeout for transmitting a request to the SCGI server. | |
1014 The timeout is set only between two successive write operations, | |
1015 not for the transmission of the whole request. | |
1016 If the SCGI server does not receive anything within this time, | |
1017 the connection is closed. | |
1018 </para> | |
1019 | |
1020 </directive> | |
1021 | |
1022 | |
1023 <directive name="scgi_store"> | |
1024 <syntax> | |
1025 <literal>on</literal> | | |
1026 <literal>off</literal> | | |
1027 <value>string</value></syntax> | |
1028 <default>off</default> | |
1029 <context>http</context> | |
1030 <context>server</context> | |
1031 <context>location</context> | |
1032 | |
1033 <para> | |
1034 Enables saving of files to a disk. | |
1035 The <literal>on</literal> parameter saves files with paths | |
1036 corresponding to the directives | |
1037 <link doc="ngx_http_core_module.xml" id="alias"/> or | |
1038 <link doc="ngx_http_core_module.xml" id="root"/>. | |
1039 The <literal>off</literal> parameter disables saving of files. | |
1040 In addition, the file name can be set explicitly using the | |
1041 <value>string</value> with variables: | |
1042 <example> | |
1043 scgi_store /data/www$original_uri; | |
1044 </example> | |
1045 </para> | |
1046 | |
1047 <para> | |
1048 The modification time of files is set according to the received | |
1049 <header>Last-Modified</header> response header field. | |
1050 The response is first written to a temporary file, | |
1051 and then the file is renamed. | |
1052 Starting from version 0.8.9, temporary files and the persistent store | |
1053 can be put on different file systems. | |
1054 However, be aware that in this case a file is copied | |
1055 across two file systems instead of the cheap renaming operation. | |
1056 It is thus recommended that for any given location both saved files and a | |
1057 directory holding temporary files, set by the <link id="scgi_temp_path"/> | |
1058 directive, are put on the same file system. | |
1059 </para> | |
1060 | |
1061 <para> | |
1062 This directive can be used to create local copies of static unchangeable | |
1063 files, e.g.: | |
1064 <example> | |
1065 location /images/ { | |
1184
55857cbf562d
Fixed alignment issues after mechanical conversion from fastcgi.
Ruslan Ermilov <ru@nginx.com>
parents:
1182
diff
changeset
|
1066 root /data/www; |
55857cbf562d
Fixed alignment issues after mechanical conversion from fastcgi.
Ruslan Ermilov <ru@nginx.com>
parents:
1182
diff
changeset
|
1067 error_page 404 = /fetch$uri; |
1180 | 1068 } |
1069 | |
1070 location /fetch/ { | |
1071 internal; | |
1072 | |
1073 scgi_pass backend:9000; | |
1074 ... | |
1075 | |
1076 scgi_store on; | |
1077 scgi_store_access user:rw group:rw all:r; | |
1078 scgi_temp_path /data/temp; | |
1079 | |
1184
55857cbf562d
Fixed alignment issues after mechanical conversion from fastcgi.
Ruslan Ermilov <ru@nginx.com>
parents:
1182
diff
changeset
|
1080 alias /data/www/; |
1180 | 1081 } |
1082 </example> | |
1083 </para> | |
1084 | |
1085 </directive> | |
1086 | |
1087 | |
1088 <directive name="scgi_store_access"> | |
1089 <syntax><value>users</value>:<value>permissions</value> ...</syntax> | |
1090 <default>user:rw</default> | |
1091 <context>http</context> | |
1092 <context>server</context> | |
1093 <context>location</context> | |
1094 | |
1095 <para> | |
1096 Sets access permissions for newly created files and directories, e.g.: | |
1097 <example> | |
1098 scgi_store_access user:rw group:rw all:r; | |
1099 </example> | |
1100 </para> | |
1101 | |
1102 <para> | |
1103 If any <literal>group</literal> or <literal>all</literal> access permissions | |
1104 are specified then <literal>user</literal> permissions may be omitted: | |
1105 <example> | |
1106 scgi_store_access group:rw all:r; | |
1107 </example> | |
1108 </para> | |
1109 | |
1110 </directive> | |
1111 | |
1112 | |
1113 <directive name="scgi_temp_file_write_size"> | |
1114 <syntax><value>size</value></syntax> | |
1115 <default>8k|16k</default> | |
1116 <context>http</context> | |
1117 <context>server</context> | |
1118 <context>location</context> | |
1119 | |
1120 <para> | |
1121 Limits the <value>size</value> of data written to a temporary file | |
1122 at a time, when buffering of responses from the SCGI server | |
1123 to temporary files is enabled. | |
1124 By default, <value>size</value> is limited by two buffers set by the | |
1125 <link id="scgi_buffer_size"/> and <link id="scgi_buffers"/> directives. | |
1126 The maximum size of a temporary file is set by the | |
1127 <link id="scgi_max_temp_file_size"/> directive. | |
1128 </para> | |
1129 | |
1130 </directive> | |
1131 | |
1132 | |
1133 <directive name="scgi_temp_path"> | |
1134 <syntax> | |
1135 <value>path</value> | |
1136 [<value>level1</value> | |
1137 [<value>level2</value> | |
1138 [<value>level3</value>]]]</syntax> | |
1139 <default>scgi_temp</default> | |
1140 <context>http</context> | |
1141 <context>server</context> | |
1142 <context>location</context> | |
1143 | |
1144 <para> | |
1145 Defines a directory for storing temporary files | |
1146 with data received from SCGI servers. | |
1147 Up to three-level subdirectory hierarchy can be used underneath the specified | |
1148 directory. | |
1149 For example, in the following configuration | |
1150 <example> | |
1151 scgi_temp_path /spool/nginx/scgi_temp 1 2; | |
1152 </example> | |
1153 a temporary file might look like this: | |
1154 <example> | |
1155 /spool/nginx/scgi_temp/<emphasis>7</emphasis>/<emphasis>45</emphasis>/00000123<emphasis>457</emphasis> | |
1156 </example> | |
1157 </para> | |
1158 | |
1159 </directive> | |
1160 | |
1161 </section> | |
1162 | |
1163 </module> |