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