Mercurial > hg > nginx-site
changeset 518:65750bdde8fb
Documented recent changes.
author | Ruslan Ermilov <ru@nginx.com> |
---|---|
date | Tue, 15 May 2012 14:57:21 +0000 |
parents | dba57bb42fec |
children | e23d718ac865 |
files | xml/en/docs/http/ngx_http_geo_module.xml xml/en/docs/http/ngx_http_geoip_module.xml xml/en/docs/http/ngx_http_realip_module.xml xml/ru/docs/http/ngx_http_geo_module.xml xml/ru/docs/http/ngx_http_geoip_module.xml xml/ru/docs/http/ngx_http_realip_module.xml |
diffstat | 6 files changed, 173 insertions(+), 25 deletions(-) [+] |
line wrap: on
line diff
--- a/xml/en/docs/http/ngx_http_geo_module.xml +++ b/xml/en/docs/http/ngx_http_geo_module.xml @@ -55,7 +55,7 @@ then the “<literal>255.255.255.255</literal>” address is used. <para> Addresses are specified as CIDR or ranges (0.7.23). -There are also five special parameters: +The following special parameters are also supported: <list type="tag"> <tag-name><literal>delete</literal></tag-name> @@ -79,12 +79,26 @@ There can be several inclusions. <tag-name><literal>proxy</literal></tag-name> <tag-desc> -sets the addresses of proxy servers (0.8.7, 0.7.63). -When a request comes from one of the proxy servers, +defines trusted addresses (0.8.7, 0.7.63). +When a request comes from a trusted address, an address from the <header>X-Forwarded-For</header> request header field will be used instead. -In contrast to the regular addresses, proxy server addresses are +In contrast to the regular addresses, trusted addresses are checked sequentially. +<note> +IPv6 addresses are supported starting from version 1.3.0. +</note> +</tag-desc> + +<tag-name><literal>proxy_recursive</literal></tag-name> +<tag-desc> +enables recursive address search (1.3.0). +If recursive search is disabled then instead of an original client +address that matches one of the trusted addresses, the last +address sent in <header>X-Forwarded-For</header> will be used. +If recursive search is enabled then instead an original client +address that matches one of the trusted addresses, the last +non-trusted address sent in <header>X-Forwarded-For</header> will be used. </tag-desc> <tag-name><literal>ranges</literal></tag-name> @@ -105,6 +119,7 @@ geo $country { include conf/geo.conf; delete 127.0.0.0/16; proxy 192.168.100.0/24; + proxy 2001:0db8::/32; 127.0.0.0/24 US; 127.0.0.1/32 RU;
--- a/xml/en/docs/http/ngx_http_geoip_module.xml +++ b/xml/en/docs/http/ngx_http_geoip_module.xml @@ -32,8 +32,11 @@ This module requires the <para> <example> http { - geoip_country GeoIP.dat; - geoip_city GeoLiteCity.dat; + geoip_country GeoIP.dat; + geoip_city GeoLiteCity.dat; + geoip_proxy 192.168.100.0/24; + geoip_proxy 2001:0db8::/32; + geoip_proxy_recursive on; ... </example> </para> @@ -130,6 +133,40 @@ postal code. </directive> + +<directive name="geoip_proxy"> +<syntax><value>address</value> | <value>CIDR</value></syntax> +<default/> +<context>http</context> +<appeared-in>1.3.0</appeared-in> + +<para> +Defines trusted addresses. +When a request comes from a trusted address, +an address from the <header>X-Forwarded-For</header> request +header field will be used instead. +</para> + +</directive> + + +<directive name="geoip_proxy_recursive"> +<syntax><literal>on</literal> | <literal>off</literal></syntax> +<default>off</default> +<context>http</context> +<appeared-in>1.3.0</appeared-in> + +<para> +If recursive search is disabled then instead of an original client +address that matches one of the trusted addresses, the last +address sent in <header>X-Forwarded-For</header> will be used. +If recursive search is enabled then instead an original client +address that matches one of the trusted addresses, the last +non-trusted address sent in <header>X-Forwarded-For</header> will be used. +</para> + +</directive> + </section> </module>
--- a/xml/en/docs/http/ngx_http_realip_module.xml +++ b/xml/en/docs/http/ngx_http_realip_module.xml @@ -26,9 +26,11 @@ configuration parameter. <para> <example> -set_real_ip_from 192.168.1.0/24; -set_real_ip_from 192.168.2.1; -real_ip_header X-Real-IP; +set_real_ip_from 192.168.1.0/24; +set_real_ip_from 192.168.2.1; +set_real_ip_from 2001:0db8::/32; +real_ip_header X-Forwarded-For; +real_ip_recursive on; </example> </para> @@ -48,10 +50,13 @@ real_ip_header X-Real-IP; <context>location</context> <para> -Describes trusted IPv4 addresses that are known to send correct +Defines trusted addresses that are known to send correct replacement addresses. If the special value <literal>unix:</literal> is specified, all UNIX-domain sockets will be trusted. +<note> +IPv6 addresses are supported starting from version 1.3.0. +</note> </para> </directive> @@ -70,9 +75,27 @@ all UNIX-domain sockets will be trusted. <para> Defines a request header field used to send the address for a replacement. -In case of the <header>X-Forwarded-For</header> field, -the last address in the field’s value is used. -For other fields the whole value is used. +</para> + +</directive> + + +<directive name="real_ip_recursive"> +<syntax><literal>on</literal> | <literal>off</literal></syntax> +<default>off</default> +<context>http</context> +<context>server</context> +<context>location</context> +<appeared-in>1.3.0</appeared-in> + +<para> +If recursive search is disabled, an original client address that +matches one of the trusted addresses is replaced by the last +address sent in the request header field defined by the +<link id="real_ip_header"/> directive. +If recursive search is enabled, an original client address that +matches one of the trusted addresses is replaced by the last +non-trusted address sent in the request header field. </para> </directive>
--- a/xml/ru/docs/http/ngx_http_geo_module.xml +++ b/xml/ru/docs/http/ngx_http_geo_module.xml @@ -55,7 +55,7 @@ geo $arg_remote_addr $geo { <para> Адреса задаются в виде CIDR или в виде диапазонов (0.7.23). -Кроме того, есть пять специальных параметров: +Также поддерживаются следующие специальные параметры: <list type="tag"> <tag-name><literal>delete</literal></tag-name> @@ -79,11 +79,25 @@ geo $arg_remote_addr $geo { <tag-name><literal>proxy</literal></tag-name> <tag-desc> -задаёт адреса прокси-серверов (0.8.7, 0.7.63), +задаёт доверенные адреса (0.8.7, 0.7.63), при запросе с которых будет использоваться адрес в переданном поле заголовка запроса <header>X-Forwarded-For</header>. -В отличие от обычных адресов, адреса прокси-серверов проверяются +В отличие от обычных адресов, доверенные адреса проверяются последовательно. +<note> +IPv6-адреса поддерживаются начиная с версии 1.3.0. +</note> +</tag-desc> + +<tag-name><literal>proxy_recursive</literal></tag-name> +<tag-desc> +включает рекурсивный поиск адреса (1.3.0). +При выключенном рекурсивном поиске вместо исходного адреса клиента, +совпадающего с одним из доверенных адресов, будет использоваться последний +адрес, переданный в <header>X-Forwarded-For</header>. +При включённом рекурсивном поиске вместо исходного адреса клиента, +совпадающего с одним из доверенных адресов, будет использоваться последний +не доверенный адрес, переданный в <header>X-Forwarded-For</header>. </tag-desc> <tag-name><literal>ranges</literal></tag-name> @@ -104,6 +118,7 @@ geo $country { include conf/geo.conf; delete 127.0.0.0/16; proxy 192.168.100.0/24; + proxy 2001:0db8::/32; 127.0.0.0/24 US; 127.0.0.1/32 RU;
--- a/xml/ru/docs/http/ngx_http_geoip_module.xml +++ b/xml/ru/docs/http/ngx_http_geoip_module.xml @@ -32,8 +32,11 @@ <para> <example> http { - geoip_country GeoIP.dat; - geoip_city GeoLiteCity.dat; + geoip_country GeoIP.dat; + geoip_city GeoLiteCity.dat; + geoip_proxy 192.168.100.0/24; + geoip_proxy 2001:0db8::/32; + geoip_proxy_recursive on; ... </example> </para> @@ -130,6 +133,38 @@ http { </directive> + +<directive name="geoip_proxy"> +<syntax><value>адрес</value> | <value>CIDR</value></syntax> +<default/> +<context>http</context> +<appeared-in>1.3.0</appeared-in> + +<para> +Задаёт доверенные адреса, при запросе с которых будет использоваться +адрес в переданном поле заголовка запроса <header>X-Forwarded-For</header>. +</para> + +</directive> + + +<directive name="geoip_proxy_recursive"> +<syntax><literal>on</literal> | <literal>off</literal></syntax> +<default>off</default> +<context>http</context> +<appeared-in>1.3.0</appeared-in> + +<para> +При выключенном рекурсивном поиске вместо исходного адреса клиента, +совпадающего с одним из доверенных адресов, будет использоваться последний +адрес, переданный в <header>X-Forwarded-For</header>. +При включённом рекурсивном поиске вместо исходного адреса клиента, +совпадающего с одним из доверенных адресов, будет использоваться последний +не доверенный адрес, переданный в <header>X-Forwarded-For</header>. +</para> + +</directive> + </section> </module>
--- a/xml/ru/docs/http/ngx_http_realip_module.xml +++ b/xml/ru/docs/http/ngx_http_realip_module.xml @@ -26,9 +26,11 @@ <para> <example> -set_real_ip_from 192.168.1.0/24; -set_real_ip_from 192.168.2.1; -real_ip_header X-Real-IP; +set_real_ip_from 192.168.1.0/24; +set_real_ip_from 192.168.2.1; +set_real_ip_from 2001:0db8::/32; +real_ip_header X-Forwarded-For; +real_ip_recursive on; </example> </para> @@ -48,10 +50,13 @@ real_ip_header X-Real-IP; <context>location</context> <para> -Описывает доверенные IPv4-адреса, которые передают верный адрес +Задаёт доверенные адреса, которые передают верный адрес для замены. Если указано специальное значение <literal>unix:</literal>, доверенными будут считаться все UNIX-сокеты. +<note> +IPv6-адреса поддерживаются начиная с версии 1.3.0. +</note> </para> </directive> @@ -70,9 +75,27 @@ real_ip_header X-Real-IP; <para> Задаёт поле заголовка запроса, в котором передаётся адрес для замены. -В случае поля <header>X-Forwarded-For</header> используется -последний адрес в значении поля. -Для остальных полей используется всё значение. +</para> + +</directive> + + +<directive name="real_ip_recursive"> +<syntax><literal>on</literal> | <literal>off</literal></syntax> +<default>off</default> +<context>http</context> +<context>server</context> +<context>location</context> +<appeared-in>1.3.0</appeared-in> + +<para> +При выключенном рекурсивном поиске исходный адрес клиента, +совпадающий с одним из доверенных адресов, заменяется на последний +адрес, переданный в поле заголовка запроса, заданного +директивой <link id="real_ip_header"/>. +При включённом рекурсивном поиске исходный адрес клиента, +совпадающий с одним из доверенных адресов, заменяется на последний +не доверенный адрес, переданный в заданном поле заголовка запроса. </para> </directive>