# HG changeset patch # User Ruslan Ermilov # Date 1340564303 0 # Node ID 95a970603b0fee65fd2ea9aa9738373cddb7a926 # Parent 32dd85720515759d0dbe685815d3a7c64d67407c Brought the "return" documentation up to date. diff --git a/xml/en/docs/http/ngx_http_rewrite_module.xml b/xml/en/docs/http/ngx_http_rewrite_module.xml --- a/xml/en/docs/http/ngx_http_rewrite_module.xml +++ b/xml/en/docs/http/ngx_http_rewrite_module.xml @@ -167,7 +167,9 @@ A value of the embedded variable $i -code +code [text] +code URL +URL server location @@ -175,12 +177,41 @@ A value of the embedded variable $i Stops processing and returns the specified code 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. + +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 text 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 ($scheme) and the + and + directives. + + + +In addition, a URL for temporary redirect with the code 302 +can be specified as the sole parameter. +Such a parameter should start with the string “http://”, +“https://”, or “$scheme”. +A URL can contain variables. + + + + +Only the following codes could be returned before version 0.7.51: +204, 400, 402 — 406, 408, 410, 411, 413, 416, and 500 — 504. + + + +The code 307 was not treated as a redirect until versions 1.1.16 and 1.0.13. + + + @@ -235,6 +266,10 @@ returns a permanent redirect with the co +The full URL of redirects is formed according to the +request scheme ($scheme) and the + and + directives. diff --git a/xml/ru/docs/http/ngx_http_rewrite_module.xml b/xml/ru/docs/http/ngx_http_rewrite_module.xml --- a/xml/ru/docs/http/ngx_http_rewrite_module.xml +++ b/xml/ru/docs/http/ngx_http_rewrite_module.xml @@ -166,7 +166,9 @@ if ($invalid_referer) { -код +код [текст] +код URL +URL server location @@ -174,12 +176,41 @@ if ($invalid_referer) { Завершает обработку и возвращает клиенту указанный код. -Можно возвращать следующие коды: 204, 400, -402 — 406, 408, 410, 411, 413, 416 и 500 — 504. -Кроме того, нестандартный код 444 закрывает соединение без передачи +Нестандартный код 444 закрывает соединение без передачи заголовка ответа. + +Начиная с версии 0.8.42 можно задать +либо URL перенаправления (для кодов 301, 302, 303 и 307), +либо текст тела ответа (для остальных кодов). +В тексте тела ответа и URL перенаправления можно использовать переменные. +Как частный случай, URL перенаправления может быть задан как URI, +локальный для данного сервера, при этом полный URL перенаправления +формируется согласно схеме запроса ($scheme) и директив + и +. + + + +Кроме того, в качестве единственного параметра можно указать +URL для временного перенаправления с кодом 302. +Такой параметр должен начинаться со строк “http://”, +“https://” или “$scheme”. +В URL можно использовать переменные. + + + + +До версии 0.7.51 можно было возвращать только следующие коды: +204, 400, 402 — 406, 408, 410, 411, 413, 416 и 500 — 504. + + + +До версий 1.1.16 и 1.0.13 код 307 не обрабатывался как перенаправление. + + + @@ -234,6 +265,10 @@ 402 — 406, 408, 410, 411, 413, 416 и 500 — 504. +Полный URL перенаправлений формируется согласно +схеме запроса ($scheme) и директив + и +.