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