# HG changeset patch # User Yaroslav Zhuravlev # Date 1473772440 -10800 # Node ID ee56773d44e863d89ad28c6713d22b963949dae8 # Parent 1626f1bf164c07ee548a552c0d35c78a6360e27f Documented ngx_stream_realip_module. diff --git a/xml/en/GNUmakefile b/xml/en/GNUmakefile --- a/xml/en/GNUmakefile +++ b/xml/en/GNUmakefile @@ -103,6 +103,7 @@ REFS = \ stream/ngx_stream_log_module \ stream/ngx_stream_map_module \ stream/ngx_stream_proxy_module \ + stream/ngx_stream_realip_module \ stream/ngx_stream_return_module \ stream/ngx_stream_split_clients_module \ stream/ngx_stream_ssl_module \ diff --git a/xml/en/docs/index.xml b/xml/en/docs/index.xml --- a/xml/en/docs/index.xml +++ b/xml/en/docs/index.xml @@ -8,7 +8,7 @@
@@ -527,6 +527,11 @@ ngx_stream_proxy_module + +ngx_stream_realip_module + + + ngx_stream_return_module diff --git a/xml/en/docs/http/ngx_http_realip_module.xml b/xml/en/docs/stream/ngx_stream_realip_module.xml copy from xml/en/docs/http/ngx_http_realip_module.xml copy to xml/en/docs/stream/ngx_stream_realip_module.xml --- a/xml/en/docs/http/ngx_http_realip_module.xml +++ b/xml/en/docs/stream/ngx_stream_realip_module.xml @@ -1,28 +1,30 @@ - + rev="1">
-The ngx_http_realip_module module is used -to change the client address and optional port -to the one sent in the specified header fields. +The ngx_stream_realip_module module is used +to change the client address and port +to the ones sent in the PROXY protocol header (1.11.4). +The PROXY protocol must be previously enabled by setting the + parameter +in the listen directive. This module is not built by default, it should be enabled with the ---with-http_realip_module +--with-stream_realip_module configuration parameter. @@ -33,11 +35,11 @@ configuration parameter. +listen 12345 proxy_protocol; + 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; @@ -52,74 +54,14 @@ real_ip_recursive on; CIDR | unix: -http +stream server -location 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 versions 1.3.0 and 1.2.1. - - - - - - - - - field | - X-Real-IP | - X-Forwarded-For | - proxy_protocol -X-Real-IP -http -server -location - - -Defines the request header field -whose value will be used to replace the client address. - - - -The X-Real-IP and X-Forwarded-For -parameters may contain an optional port (1.11.0). -The address and port should be specified according to -RFC 3986. - - - -The proxy_protocol parameter (1.5.12) changes -the client address to the one from the PROXY protocol header. -The PROXY protocol must be previously enabled by setting the -proxy_protocol parameter -in the directive. - - - - - - -on | off -off -http -server -location -1.3.0 -1.2.1 - - -If recursive search is disabled, the 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, the original client address that -matches one of the trusted addresses is replaced by the last -non-trusted address sent in the request header field. @@ -134,12 +76,12 @@ non-trusted address sent in the request $realip_remote_addr -keeps the original client address (1.9.7) +keeps the original client address $realip_remote_port -keeps the original client port (1.11.0) +keeps the original client port diff --git a/xml/ru/GNUmakefile b/xml/ru/GNUmakefile --- a/xml/ru/GNUmakefile +++ b/xml/ru/GNUmakefile @@ -91,6 +91,7 @@ REFS = \ stream/ngx_stream_log_module \ stream/ngx_stream_map_module \ stream/ngx_stream_proxy_module \ + stream/ngx_stream_realip_module \ stream/ngx_stream_return_module \ stream/ngx_stream_split_clients_module \ stream/ngx_stream_ssl_module \ diff --git a/xml/ru/docs/index.xml b/xml/ru/docs/index.xml --- a/xml/ru/docs/index.xml +++ b/xml/ru/docs/index.xml @@ -8,7 +8,7 @@
@@ -531,6 +531,11 @@ ngx_stream_proxy_module + +ngx_stream_realip_module + + + ngx_stream_return_module diff --git a/xml/ru/docs/http/ngx_http_realip_module.xml b/xml/ru/docs/stream/ngx_stream_realip_module.xml copy from xml/ru/docs/http/ngx_http_realip_module.xml copy to xml/ru/docs/stream/ngx_stream_realip_module.xml --- a/xml/ru/docs/http/ngx_http_realip_module.xml +++ b/xml/ru/docs/stream/ngx_stream_realip_module.xml @@ -1,29 +1,31 @@ - + rev="1">
-Модуль ngx_http_realip_module позволяет -менять адрес и необязательный порт клиента -на переданный в указанных полях заголовка. +Модуль ngx_stream_realip_module позволяет +менять адрес и порт клиента +на переданные в заголовке протокола PROXY (1.11.4). +Протокол PROXY должен быть предварительно включён при помощи установки +параметра +в директиве listen. По умолчанию этот модуль не собирается, его сборку необходимо разрешить с помощью конфигурационного параметра ---with-http_realip_module. +--with-stream_realip_module.
@@ -33,11 +35,11 @@ +listen 12345 proxy_protocol; + 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; @@ -52,74 +54,14 @@ real_ip_recursive on; CIDR | unix: -http +stream server -location Задаёт доверенные адреса, которые передают верный адрес для замены. Если указано специальное значение unix:, доверенными будут считаться все UNIX-сокеты. - -IPv6-адреса поддерживаются начиная с версий 1.3.0 и 1.2.1. - - - - - - - - - поле | - X-Real-IP | - X-Forwarded-For | - proxy_protocol -X-Real-IP -http -server -location - - -Задаёт поле заголовка запроса, -значение которого будет использоваться для замены адреса клиента. - - - -Параметры X-Real-IP и X-Forwarded-For -могут содержать необязательный порт (1.11.0). -Адрес и порт должны быть указаны согласно -RFC 3986. - - - -Параметр proxy_protocol (1.5.12) меняет -адрес клиента на указанный в заголовке PROXY-протокола. -Протокол PROXY должен быть предварительно включён при помощи установки -параметра proxy_protocol в директиве -. - - - - - - -on | off -off -http -server -location -1.3.0 -1.2.1 - - -При выключенном рекурсивном поиске исходный адрес клиента, -совпадающий с одним из доверенных адресов, заменяется на последний -адрес, переданный в поле заголовка запроса, заданного -директивой . -При включённом рекурсивном поиске исходный адрес клиента, -совпадающий с одним из доверенных адресов, заменяется на последний -не доверенный адрес, переданный в заданном поле заголовка запроса. @@ -134,12 +76,12 @@ IPv6-адреса поддерживаются начиная с версий 1.3.0 и 1.2.1. $realip_remote_addr -хранит исходный адрес клиента (1.9.7) +хранит исходный адрес клиента $realip_remote_port -хранит исходный порт клиента (1.11.0) +хранит исходный порт клиента