# HG changeset patch # User Vladimir Homutov # Date 1369311276 -14400 # Node ID 474a21f26a2a4e3af5a75c455a965a53779e0785 # Parent 9a65d437da427cf1be472903e5dcfef3ff8a1681 Documented location behavior with proxying directives. diff --git a/xml/en/docs/http/ngx_http_core_module.xml b/xml/en/docs/http/ngx_http_core_module.xml --- a/xml/en/docs/http/ngx_http_core_module.xml +++ b/xml/en/docs/http/ngx_http_core_module.xml @@ -10,7 +10,7 @@ + rev="20">
@@ -1479,6 +1479,31 @@ used for request redirection. They cannot be nested, and cannot contain nested locations. + +If a location is defined by a prefix string that ends with the slash character, +and requests are processed by one of +, +, +, +, or +, +then in response to a request with URI equal to this string, +but without the trailing slash, +a permanent redirect with the code 301 will be returned to the requested URI +with the slash appended. +If this is undesired, an exact match of the URI and location could be +defined like this: + +location /user/ { + proxy_pass http://user.example.com; +} + +location = /user { + proxy_pass http://login.example.com; +} + + + diff --git a/xml/ru/docs/http/ngx_http_core_module.xml b/xml/ru/docs/http/ngx_http_core_module.xml --- a/xml/ru/docs/http/ngx_http_core_module.xml +++ b/xml/ru/docs/http/ngx_http_core_module.xml @@ -10,7 +10,7 @@ + rev="20">
@@ -1467,6 +1467,30 @@ location ~* \.(gif|jpg|jpeg)$ { вложенные location’ы. + +Если location задан префиксной строкой со слэшом в конце +и запросы обрабатываются при помощи +, +, +, + или +, +а в ответ на запрос с URI равным этой строке, но без завершающего слэша, +будет возвращено постоянное перенаправление с кодом 301 +на URI с добавленным в конец слэшом. +Если такое поведение нежелательно, можно задать точное совпадение +URI и location, например: + +location /user/ { + proxy_pass http://user.example.com; +} + +location = /user { + proxy_pass http://login.example.com; +} + + +