changeset 1779:ee56773d44e8

Documented ngx_stream_realip_module.
author Yaroslav Zhuravlev <yar@nginx.com>
date Tue, 13 Sep 2016 16:14:00 +0300
parents 1626f1bf164c
children 8df9ba4e56c6
files xml/en/GNUmakefile xml/en/docs/index.xml xml/en/docs/stream/ngx_stream_realip_module.xml xml/ru/GNUmakefile xml/ru/docs/index.xml xml/ru/docs/stream/ngx_stream_realip_module.xml
diffstat 6 files changed, 44 insertions(+), 148 deletions(-) [+]
line wrap: on
line diff
--- 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				\
--- a/xml/en/docs/index.xml
+++ b/xml/en/docs/index.xml
@@ -8,7 +8,7 @@
 <article name="nginx documentation"
          link="/en/docs/"
          lang="en"
-         rev="31"
+         rev="32"
          toc="no">
 
 
@@ -527,6 +527,11 @@ ngx_stream_proxy_module</link>
 </listitem>
 
 <listitem>
+<link doc="stream/ngx_stream_realip_module.xml">
+ngx_stream_realip_module</link>
+</listitem>
+
+<listitem>
 <link doc="stream/ngx_stream_return_module.xml">
 ngx_stream_return_module</link>
 </listitem>
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 @@
 <?xml version="1.0"?>
 
 <!--
-  Copyright (C) Igor Sysoev
   Copyright (C) Nginx, Inc.
   -->
 
 <!DOCTYPE module SYSTEM "../../../../dtd/module.dtd">
 
-<module name="Module ngx_http_realip_module"
-        link="/en/docs/http/ngx_http_realip_module.html"
+<module name="Module ngx_stream_realip_module"
+        link="/en/docs/stream/ngx_stream_realip_module.html"
         lang="en"
-        rev="5">
+        rev="1">
 
 <section id="summary">
 
 <para>
-The <literal>ngx_http_realip_module</literal> module is used
-to change the client address and optional port
-to the one sent in the specified header fields.
+The <literal>ngx_stream_realip_module</literal> 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
+<link doc="ngx_stream_core_module.xml" id="proxy_protocol"/> parameter
+in the <literal>listen</literal> directive.
 </para>
 
 <para>
 This module is not built by default, it should be enabled with the
-<literal>--with-http_realip_module</literal>
+<literal>--with-stream_realip_module</literal>
 configuration parameter.
 </para>
 
@@ -33,11 +35,11 @@ configuration parameter.
 
 <para>
 <example>
+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;
 </example>
 </para>
 
@@ -52,74 +54,14 @@ real_ip_recursive on;
     <value>CIDR</value> |
     <literal>unix:</literal></syntax>
 <default/>
-<context>http</context>
+<context>stream</context>
 <context>server</context>
-<context>location</context>
 
 <para>
 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 versions 1.3.0 and 1.2.1.
-</note>
-</para>
-
-</directive>
-
-
-<directive name="real_ip_header">
-<syntax>
-    <value>field</value> |
-    <literal>X-Real-IP</literal> |
-    <literal>X-Forwarded-For</literal> |
-    <literal>proxy_protocol</literal></syntax>
-<default>X-Real-IP</default>
-<context>http</context>
-<context>server</context>
-<context>location</context>
-
-<para>
-Defines the request header field
-whose value will be used to replace the client address.
-</para>
-
-<para>
-The <literal>X-Real-IP</literal> and <literal>X-Forwarded-For</literal>
-parameters may contain an optional port (1.11.0).
-The address and port should be specified according to
-<link url="http://tools.ietf.org/html/3986">RFC 3986</link>.
-</para>
-
-<para>
-The <literal>proxy_protocol</literal> 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
-<literal>proxy_protocol</literal> parameter
-in the <link doc="ngx_http_core_module.xml" id="listen"/> directive.
-</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>
-<appeared-in>1.2.1</appeared-in>
-
-<para>
-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
-<link id="real_ip_header"/> 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.
 </para>
 
 </directive>
@@ -134,12 +76,12 @@ non-trusted address sent in the request 
 
 <tag-name id="var_realip_remote_addr"><var>$realip_remote_addr</var></tag-name>
 <tag-desc>
-keeps the original client address (1.9.7)
+keeps the original client address
 </tag-desc>
 
 <tag-name id="var_realip_remote_port"><var>$realip_remote_port</var></tag-name>
 <tag-desc>
-keeps the original client port (1.11.0)
+keeps the original client port
 </tag-desc>
 
 </list>
--- 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				\
--- a/xml/ru/docs/index.xml
+++ b/xml/ru/docs/index.xml
@@ -8,7 +8,7 @@
 <article name="nginx: документация"
          link="/ru/docs/"
          lang="ru"
-         rev="31"
+         rev="32"
          toc="no">
 
 
@@ -531,6 +531,11 @@ ngx_stream_proxy_module</link>
 </listitem>
 
 <listitem>
+<link doc="stream/ngx_stream_realip_module.xml">
+ngx_stream_realip_module</link>
+</listitem>
+
+<listitem>
 <link doc="stream/ngx_stream_return_module.xml">
 ngx_stream_return_module</link>
 </listitem>
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 @@
 <?xml version="1.0"?>
 
 <!--
-  Copyright (C) Igor Sysoev
   Copyright (C) Nginx, Inc.
   -->
 
 <!DOCTYPE module SYSTEM "../../../../dtd/module.dtd">
 
-<module name="Модуль ngx_http_realip_module"
-        link="/ru/docs/http/ngx_http_realip_module.html"
+<module name="Модуль ngx_stream_realip_module"
+        link="/ru/docs/stream/ngx_stream_realip_module.html"
         lang="ru"
-        rev="5">
+        rev="1">
 
 <section id="summary">
 
 <para>
-Модуль <literal>ngx_http_realip_module</literal> позволяет
-менять адрес и необязательный порт клиента
-на переданный в указанных полях заголовка.
+Модуль <literal>ngx_stream_realip_module</literal> позволяет
+менять адрес и порт клиента
+на переданные в заголовке протокола PROXY (1.11.4).
+Протокол PROXY должен быть предварительно включён при помощи установки
+параметра <link doc="ngx_stream_core_module.xml" id="proxy_protocol"/>
+в директиве <literal>listen</literal>.
 </para>
 
 <para>
 По умолчанию этот модуль не собирается, его сборку необходимо
 разрешить с помощью конфигурационного параметра
-<literal>--with-http_realip_module</literal>.
+<literal>--with-stream_realip_module</literal>.
 </para>
 
 </section>
@@ -33,11 +35,11 @@
 
 <para>
 <example>
+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;
 </example>
 </para>
 
@@ -52,74 +54,14 @@ real_ip_recursive on;
     <value>CIDR</value> |
     <literal>unix:</literal></syntax>
 <default/>
-<context>http</context>
+<context>stream</context>
 <context>server</context>
-<context>location</context>
 
 <para>
 Задаёт доверенные адреса, которые передают верный адрес
 для замены.
 Если указано специальное значение <literal>unix:</literal>,
 доверенными будут считаться все UNIX-сокеты.
-<note>
-IPv6-адреса поддерживаются начиная с версий 1.3.0 и 1.2.1.
-</note>
-</para>
-
-</directive>
-
-
-<directive name="real_ip_header">
-<syntax>
-    <value>поле</value> |
-    <literal>X-Real-IP</literal> |
-    <literal>X-Forwarded-For</literal> |
-    <literal>proxy_protocol</literal></syntax>
-<default>X-Real-IP</default>
-<context>http</context>
-<context>server</context>
-<context>location</context>
-
-<para>
-Задаёт поле заголовка запроса,
-значение которого будет использоваться для замены адреса клиента.
-</para>
-
-<para>
-Параметры <literal>X-Real-IP</literal> и <literal>X-Forwarded-For</literal>
-могут содержать необязательный порт (1.11.0).
-Адрес и порт должны быть указаны согласно
-<link url="http://tools.ietf.org/html/3986">RFC 3986</link>.
-</para>
-
-<para>
-Параметр <literal>proxy_protocol</literal> (1.5.12) меняет
-адрес клиента на указанный в заголовке PROXY-протокола.
-Протокол PROXY должен быть предварительно включён при помощи установки
-параметра <literal>proxy_protocol</literal> в директиве
-<link doc="ngx_http_core_module.xml" id="listen"/>.
-</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>
-<appeared-in>1.2.1</appeared-in>
-
-<para>
-При выключенном рекурсивном поиске исходный адрес клиента,
-совпадающий с одним из доверенных адресов, заменяется на последний
-адрес, переданный в поле заголовка запроса, заданного
-директивой <link id="real_ip_header"/>.
-При включённом рекурсивном поиске исходный адрес клиента,
-совпадающий с одним из доверенных адресов, заменяется на последний
-не доверенный адрес, переданный в заданном поле заголовка запроса.
 </para>
 
 </directive>
@@ -134,12 +76,12 @@ IPv6-адреса поддерживаются начиная с версий 1.3.0 и 1.2.1.
 
 <tag-name id="var_realip_remote_addr"><var>$realip_remote_addr</var></tag-name>
 <tag-desc>
-хранит исходный адрес клиента (1.9.7)
+хранит исходный адрес клиента
 </tag-desc>
 
 <tag-name id="var_realip_remote_port"><var>$realip_remote_port</var></tag-name>
 <tag-desc>
-хранит исходный порт клиента (1.11.0)
+хранит исходный порт клиента
 </tag-desc>
 
 </list>