Mercurial > hg > nginx-site
comparison xml/en/docs/http/ngx_http_rewrite_module.xml @ 548:95a970603b0f
Brought the "return" documentation up to date.
author | Ruslan Ermilov <ru@nginx.com> |
---|---|
date | Sun, 24 Jun 2012 18:58:23 +0000 |
parents | 0491cb7e874b |
children | be54c443235a |
comparison
equal
deleted
inserted
replaced
547:32dd85720515 | 548:95a970603b0f |
---|---|
165 | 165 |
166 </directive> | 166 </directive> |
167 | 167 |
168 | 168 |
169 <directive name="return"> | 169 <directive name="return"> |
170 <syntax><value>code</value></syntax> | 170 <syntax><value>code</value> [<value>text</value>]</syntax> |
171 <syntax><value>code</value> <value>URL</value></syntax> | |
172 <syntax><value>URL</value></syntax> | |
171 <default/> | 173 <default/> |
172 <context>server</context> | 174 <context>server</context> |
173 <context>location</context> | 175 <context>location</context> |
174 <context>if</context> | 176 <context>if</context> |
175 | 177 |
176 <para> | 178 <para> |
177 Stops processing and returns the specified <value>code</value> to a client. | 179 Stops processing and returns the specified <value>code</value> to a client. |
178 The following codes can be returned: 204, 400, | 180 The non-standard code 444 closes a connection without sending |
179 402 — 406, 408, 410, 411, 413, 416, and 500 — 504. | |
180 In addition, the non-standard code 444 closes a connection without sending | |
181 a response header. | 181 a response header. |
182 </para> | |
183 | |
184 <para> | |
185 Starting from version 0.8.42, it is possible to specify | |
186 either the URL of redirect (for codes 301, 302, 303, and 307), | |
187 or the <value>text</value> of a response body (for other codes). | |
188 A response body text or URL of redirect can contain variables. | |
189 As a special case, a URL of redirect can be specified as a URI | |
190 local to this server, in which case the full URL of redirect | |
191 is formed according to the request scheme (<var>$scheme</var>) and the | |
192 <link doc="ngx_http_core_module.xml" id="server_name_in_redirect"/> and | |
193 <link doc="ngx_http_core_module.xml" id="port_in_redirect"/> directives. | |
194 </para> | |
195 | |
196 <para> | |
197 In addition, a <value>URL</value> for temporary redirect with the code 302 | |
198 can be specified as the sole parameter. | |
199 Such a parameter should start with the string “<literal>http://</literal>”, | |
200 “<literal>https://</literal>”, or “<literal>$scheme</literal>”. | |
201 A <value>URL</value> can contain variables. | |
202 </para> | |
203 | |
204 <para> | |
205 <note> | |
206 Only the following codes could be returned before version 0.7.51: | |
207 204, 400, 402 — 406, 408, 410, 411, 413, 416, and 500 — 504. | |
208 </note> | |
209 | |
210 <note> | |
211 The code 307 was not treated as a redirect until versions 1.1.16 and 1.0.13. | |
212 </note> | |
182 </para> | 213 </para> |
183 | 214 |
184 </directive> | 215 </directive> |
185 | 216 |
186 | 217 |
233 <tag-desc> | 264 <tag-desc> |
234 returns a permanent redirect with the code 301. | 265 returns a permanent redirect with the code 301. |
235 </tag-desc> | 266 </tag-desc> |
236 | 267 |
237 </list> | 268 </list> |
269 The full URL of redirects is formed according to the | |
270 request scheme (<var>$scheme</var>) and the | |
271 <link doc="ngx_http_core_module.xml" id="server_name_in_redirect"/> and | |
272 <link doc="ngx_http_core_module.xml" id="port_in_redirect"/> directives. | |
238 </para> | 273 </para> |
239 | 274 |
240 <para> | 275 <para> |
241 Example: | 276 Example: |
242 <example> | 277 <example> |