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