diff 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
line wrap: on
line diff
--- a/xml/en/docs/http/ngx_http_rewrite_module.xml	Sun Jun 24 18:47:05 2012 +0000
+++ b/xml/en/docs/http/ngx_http_rewrite_module.xml	Sun Jun 24 18:58:23 2012 +0000
@@ -167,7 +167,9 @@
 
 
 <directive name="return">
-<syntax><value>code</value></syntax>
+<syntax><value>code</value> [<value>text</value>]</syntax>
+<syntax><value>code</value> <value>URL</value></syntax>
+<syntax><value>URL</value></syntax>
 <default/>
 <context>server</context>
 <context>location</context>
@@ -175,12 +177,41 @@
 
 <para>
 Stops processing and returns the specified <value>code</value> to a client.
-The following codes can be returned: 204, 400,
-402 — 406, 408, 410, 411, 413, 416, and 500 — 504.
-In addition, the non-standard code 444 closes a connection without sending
+The non-standard code 444 closes a connection without sending
 a response header.
 </para>
 
+<para>
+Starting from version 0.8.42, it is possible to specify
+either the URL of redirect (for codes 301, 302, 303, and 307),
+or the <value>text</value> of a response body (for other codes).
+A response body text or URL of redirect can contain variables.
+As a special case, a URL of redirect can be specified as a URI
+local to this server, in which case the full URL of redirect
+is formed according to the request scheme (<var>$scheme</var>) and the
+<link doc="ngx_http_core_module.xml" id="server_name_in_redirect"/> and
+<link doc="ngx_http_core_module.xml" id="port_in_redirect"/> directives.
+</para>
+
+<para>
+In addition, a <value>URL</value> for temporary redirect with the code 302
+can be specified as the sole parameter.
+Such a parameter should start with the string “<literal>http://</literal>”,
+“<literal>https://</literal>”, or “<literal>$scheme</literal>”.
+A <value>URL</value> can contain variables.
+</para>
+
+<para>
+<note>
+Only the following codes could be returned before version 0.7.51:
+204, 400, 402 — 406, 408, 410, 411, 413, 416, and 500 — 504.
+</note>
+
+<note>
+The code 307 was not treated as a redirect until versions 1.1.16 and 1.0.13.
+</note>
+</para>
+
 </directive>
 
 
@@ -235,6 +266,10 @@
 </tag-desc>
 
 </list>
+The full URL of redirects is formed according to the
+request scheme (<var>$scheme</var>) and the
+<link doc="ngx_http_core_module.xml" id="server_name_in_redirect"/> and
+<link doc="ngx_http_core_module.xml" id="port_in_redirect"/> directives.
 </para>
 
 <para>