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