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