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