Mercurial > hg > nginx-site
diff xml/en/docs/http/ngx_http_proxy_module.xml @ 1990:a108f1ff1690
Better documented proxy_pass with variables (ticket #803).
author | Ruslan Ermilov <ru@nginx.com> |
---|---|
date | Fri, 26 May 2017 18:58:02 +0300 |
parents | 7bf1a73248f5 |
children | fc3ba2e76974 |
line wrap: on
line diff
--- a/xml/en/docs/http/ngx_http_proxy_module.xml +++ b/xml/en/docs/http/ngx_http_proxy_module.xml @@ -10,7 +10,7 @@ <module name="Module ngx_http_proxy_module" link="/en/docs/http/ngx_http_proxy_module.html" lang="en" - rev="61"> + rev="62"> <section id="summary"> @@ -1377,6 +1377,14 @@ In addition, an address can be specified </para> <para> +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 +<link doc="ngx_http_core_module.xml" id="resolver"/>. +</para> + +<para> A request URI is passed to the server as follows: <list type="bullet" compact="no"> @@ -1443,26 +1451,19 @@ In this case, the URI specified in the d the full changed request URI is passed to the server. </para> </listitem> -</list> -</para> -<para> -A server name, its port and the passed URI can also be specified using -variables: +<listitem> +When variables are used in <literal>proxy_pass</literal>: <example> -proxy_pass http://$host$uri; +location /name/ { + proxy_pass http://127.0.0.1$request_uri; +} </example> -or even like this: -<example> -proxy_pass $request; -</example> -</para> - -<para> -In this case, the server name is searched among the described -<link doc="ngx_http_upstream_module.xml">server groups</link>, -and, if not found, is determined using a -<link doc="ngx_http_core_module.xml" id="resolver"/>. +In this case, if URI is specified in the directive, +it is passed to the server as is, +replacing the original request URI. +</listitem> +</list> </para> <para>