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