# HG changeset patch # User Ruslan Ermilov # Date 1495814282 -10800 # Node ID a108f1ff1690f54051c03bd5c35378d0fdffdcea # Parent 7bf1a73248f54b2fe59ab00cd87bd37a23e1fe93 Better documented proxy_pass with variables (ticket #803). diff -r 7bf1a73248f5 -r a108f1ff1690 xml/en/docs/http/ngx_http_proxy_module.xml --- a/xml/en/docs/http/ngx_http_proxy_module.xml Fri May 26 18:58:01 2017 +0300 +++ b/xml/en/docs/http/ngx_http_proxy_module.xml Fri May 26 18:58:02 2017 +0300 @@ -10,7 +10,7 @@ + rev="62">
@@ -1377,6 +1377,14 @@ +Parameter value can contain variables. +In this case, if an address is specified as a domain name, +the name is searched among the described server groups, +and, if not found, is determined using a +. + + + A request URI is passed to the server as follows: @@ -1443,26 +1451,19 @@ the full changed request URI is passed to the server. - - - -A server name, its port and the passed URI can also be specified using -variables: + +When variables are used in proxy_pass: -proxy_pass http://$host$uri; +location /name/ { + proxy_pass http://127.0.0.1$request_uri; +} -or even like this: - -proxy_pass $request; - - - - -In this case, the server name is searched among the described -server groups, -and, if not found, is determined using a -. +In this case, if URI is specified in the directive, +it is passed to the server as is, +replacing the original request URI. + + diff -r 7bf1a73248f5 -r a108f1ff1690 xml/ru/docs/http/ngx_http_proxy_module.xml --- a/xml/ru/docs/http/ngx_http_proxy_module.xml Fri May 26 18:58:01 2017 +0300 +++ b/xml/ru/docs/http/ngx_http_proxy_module.xml Fri May 26 18:58:02 2017 +0300 @@ -10,7 +10,7 @@ + rev="62">
@@ -1379,6 +1379,14 @@ +В значении параметра можно использовать переменные. +В этом случае, если адрес указан в виде доменного имени, +имя ищется среди описанных групп серверов +и если не найдено, то определяется с помощью +’а. + + + URI запроса передаётся на сервер так: @@ -1445,26 +1453,19 @@ передаётся изменённый URI запроса целиком. - - - -Имя сервера, его порт и передаваемый URI можно также полностью задать -с помощью переменных: + +При использовании переменных в proxy_pass: -proxy_pass http://$host$uri; +location /name/ { + proxy_pass http://127.0.0.1$request_uri; +} -или даже так: - -proxy_pass $request; - - - - -В этом случае имя сервера ищется среди описанных -групп серверов -и если не найдено, то определяется с помощью -’а. +В этом случае если в директиве указан URI, +он передаётся на сервер как есть, +заменяя URI первоначального запроса. + +