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