# HG changeset patch # User Ruslan Ermilov # Date 1337093841 0 # Node ID 65750bdde8fb9087487f31558c8f8c2c52339cca # Parent dba57bb42fecda7db378984d88af5a68850eb553 Documented recent changes. diff -r dba57bb42fec -r 65750bdde8fb xml/en/docs/http/ngx_http_geo_module.xml --- a/xml/en/docs/http/ngx_http_geo_module.xml Tue May 15 14:34:50 2012 +0000 +++ b/xml/en/docs/http/ngx_http_geo_module.xml Tue May 15 14:57:21 2012 +0000 @@ -55,7 +55,7 @@ Addresses are specified as CIDR or ranges (0.7.23). -There are also five special parameters: +The following special parameters are also supported: delete @@ -79,12 +79,26 @@ proxy -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
X-Forwarded-For
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. + +IPv6 addresses are supported starting from version 1.3.0. + +
+ +proxy_recursive + +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
X-Forwarded-For
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
X-Forwarded-For
will be used.
ranges @@ -105,6 +119,7 @@ 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; diff -r dba57bb42fec -r 65750bdde8fb xml/en/docs/http/ngx_http_geoip_module.xml --- a/xml/en/docs/http/ngx_http_geoip_module.xml Tue May 15 14:34:50 2012 +0000 +++ b/xml/en/docs/http/ngx_http_geoip_module.xml Tue May 15 14:57:21 2012 +0000 @@ -32,8 +32,11 @@ 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; ... @@ -130,6 +133,40 @@ + + +address | CIDR + +http +1.3.0 + + +Defines trusted addresses. +When a request comes from a trusted address, +an address from the
X-Forwarded-For
request +header field will be used instead. +
+ +
+ + + +on | off +off +http +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
X-Forwarded-For
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
X-Forwarded-For
will be used. +
+ +
+ diff -r dba57bb42fec -r 65750bdde8fb xml/en/docs/http/ngx_http_realip_module.xml --- a/xml/en/docs/http/ngx_http_realip_module.xml Tue May 15 14:34:50 2012 +0000 +++ b/xml/en/docs/http/ngx_http_realip_module.xml Tue May 15 14:57:21 2012 +0000 @@ -26,9 +26,11 @@ -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; @@ -48,10 +50,13 @@ location -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 unix: is specified, all UNIX-domain sockets will be trusted. + +IPv6 addresses are supported starting from version 1.3.0. + @@ -70,9 +75,27 @@ Defines a request header field used to send the address for a replacement. -In case of the
X-Forwarded-For
field, -the last address in the field’s value is used. -For other fields the whole value is used. +
+ + + + + +on | off +off +http +server +location +1.3.0 + + +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 + 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. diff -r dba57bb42fec -r 65750bdde8fb xml/ru/docs/http/ngx_http_geo_module.xml --- a/xml/ru/docs/http/ngx_http_geo_module.xml Tue May 15 14:34:50 2012 +0000 +++ b/xml/ru/docs/http/ngx_http_geo_module.xml Tue May 15 14:57:21 2012 +0000 @@ -55,7 +55,7 @@ Адреса задаются в виде CIDR или в виде диапазонов (0.7.23). -Кроме того, есть пять специальных параметров: +Также поддерживаются следующие специальные параметры: delete @@ -79,11 +79,25 @@ proxy -задаёт адреса прокси-серверов (0.8.7, 0.7.63), +задаёт доверенные адреса (0.8.7, 0.7.63), при запросе с которых будет использоваться адрес в переданном поле заголовка запроса
X-Forwarded-For
. -В отличие от обычных адресов, адреса прокси-серверов проверяются +В отличие от обычных адресов, доверенные адреса проверяются последовательно. + +IPv6-адреса поддерживаются начиная с версии 1.3.0. + +
+ +proxy_recursive + +включает рекурсивный поиск адреса (1.3.0). +При выключенном рекурсивном поиске вместо исходного адреса клиента, +совпадающего с одним из доверенных адресов, будет использоваться последний +адрес, переданный в
X-Forwarded-For
. +При включённом рекурсивном поиске вместо исходного адреса клиента, +совпадающего с одним из доверенных адресов, будет использоваться последний +не доверенный адрес, переданный в
X-Forwarded-For
.
ranges @@ -104,6 +118,7 @@ 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; diff -r dba57bb42fec -r 65750bdde8fb xml/ru/docs/http/ngx_http_geoip_module.xml --- a/xml/ru/docs/http/ngx_http_geoip_module.xml Tue May 15 14:34:50 2012 +0000 +++ b/xml/ru/docs/http/ngx_http_geoip_module.xml Tue May 15 14:57:21 2012 +0000 @@ -32,8 +32,11 @@ 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; ... @@ -130,6 +133,38 @@ + + +адрес | CIDR + +http +1.3.0 + + +Задаёт доверенные адреса, при запросе с которых будет использоваться +адрес в переданном поле заголовка запроса
X-Forwarded-For
. +
+ +
+ + + +on | off +off +http +1.3.0 + + +При выключенном рекурсивном поиске вместо исходного адреса клиента, +совпадающего с одним из доверенных адресов, будет использоваться последний +адрес, переданный в
X-Forwarded-For
. +При включённом рекурсивном поиске вместо исходного адреса клиента, +совпадающего с одним из доверенных адресов, будет использоваться последний +не доверенный адрес, переданный в
X-Forwarded-For
. +
+ +
+ diff -r dba57bb42fec -r 65750bdde8fb xml/ru/docs/http/ngx_http_realip_module.xml --- a/xml/ru/docs/http/ngx_http_realip_module.xml Tue May 15 14:34:50 2012 +0000 +++ b/xml/ru/docs/http/ngx_http_realip_module.xml Tue May 15 14:57:21 2012 +0000 @@ -26,9 +26,11 @@ -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; @@ -48,10 +50,13 @@ location -Описывает доверенные IPv4-адреса, которые передают верный адрес +Задаёт доверенные адреса, которые передают верный адрес для замены. Если указано специальное значение unix:, доверенными будут считаться все UNIX-сокеты. + +IPv6-адреса поддерживаются начиная с версии 1.3.0. + @@ -70,9 +75,27 @@ Задаёт поле заголовка запроса, в котором передаётся адрес для замены. -В случае поля
X-Forwarded-For
используется -последний адрес в значении поля. -Для остальных полей используется всё значение. +
+ + + + + +on | off +off +http +server +location +1.3.0 + + +При выключенном рекурсивном поиске исходный адрес клиента, +совпадающий с одним из доверенных адресов, заменяется на последний +адрес, переданный в поле заголовка запроса, заданного +директивой . +При включённом рекурсивном поиске исходный адрес клиента, +совпадающий с одним из доверенных адресов, заменяется на последний +не доверенный адрес, переданный в заданном поле заголовка запроса.