Mercurial > hg > nginx-site
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, 198 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/xml/en/GNUmakefile Tue Sep 13 16:03:19 2016 +0300 +++ b/xml/en/GNUmakefile Tue Sep 13 16:14:00 2016 +0300 @@ -103,6 +103,7 @@ 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 Tue Sep 13 16:03:19 2016 +0300 +++ b/xml/en/docs/index.xml Tue Sep 13 16:14:00 2016 +0300 @@ -8,7 +8,7 @@ <article name="nginx documentation" link="/en/docs/" lang="en" - rev="31" + rev="32" toc="no"> @@ -527,6 +527,11 @@ </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>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/xml/en/docs/stream/ngx_stream_realip_module.xml Tue Sep 13 16:14:00 2016 +0300 @@ -0,0 +1,92 @@ +<?xml version="1.0"?> + +<!-- + Copyright (C) Nginx, Inc. + --> + +<!DOCTYPE module SYSTEM "../../../../dtd/module.dtd"> + +<module name="Module ngx_stream_realip_module" + link="/en/docs/stream/ngx_stream_realip_module.html" + lang="en" + rev="1"> + +<section id="summary"> + +<para> +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-stream_realip_module</literal> +configuration parameter. +</para> + +</section> + + +<section id="example" name="Example Configuration"> + +<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; +</example> +</para> + +</section> + + +<section id="directives" name="Directives"> + +<directive name="set_real_ip_from"> +<syntax> + <value>address</value> | + <value>CIDR</value> | + <literal>unix:</literal></syntax> +<default/> +<context>stream</context> +<context>server</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. +</para> + +</directive> + +</section> + + +<section id="variables" name="Embedded Variables"> + +<para> +<list type="tag"> + +<tag-name id="var_realip_remote_addr"><var>$realip_remote_addr</var></tag-name> +<tag-desc> +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 +</tag-desc> + +</list> +</para> + +</section> + +</module>
--- a/xml/ru/GNUmakefile Tue Sep 13 16:03:19 2016 +0300 +++ b/xml/ru/GNUmakefile Tue Sep 13 16:14:00 2016 +0300 @@ -91,6 +91,7 @@ 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 Tue Sep 13 16:03:19 2016 +0300 +++ b/xml/ru/docs/index.xml Tue Sep 13 16:14:00 2016 +0300 @@ -8,7 +8,7 @@ <article name="nginx: документация" link="/ru/docs/" lang="ru" - rev="31" + rev="32" toc="no"> @@ -531,6 +531,11 @@ </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>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/xml/ru/docs/stream/ngx_stream_realip_module.xml Tue Sep 13 16:14:00 2016 +0300 @@ -0,0 +1,92 @@ +<?xml version="1.0"?> + +<!-- + Copyright (C) Nginx, Inc. + --> + +<!DOCTYPE module SYSTEM "../../../../dtd/module.dtd"> + +<module name="Модуль ngx_stream_realip_module" + link="/ru/docs/stream/ngx_stream_realip_module.html" + lang="ru" + rev="1"> + +<section id="summary"> + +<para> +Модуль <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-stream_realip_module</literal>. +</para> + +</section> + + +<section id="example" name="Пример конфигурации"> + +<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; +</example> +</para> + +</section> + + +<section id="directives" name="Директивы"> + +<directive name="set_real_ip_from"> +<syntax> + <value>адрес</value> | + <value>CIDR</value> | + <literal>unix:</literal></syntax> +<default/> +<context>stream</context> +<context>server</context> + +<para> +Задаёт доверенные адреса, которые передают верный адрес +для замены. +Если указано специальное значение <literal>unix:</literal>, +доверенными будут считаться все UNIX-сокеты. +</para> + +</directive> + +</section> + + +<section id="variables" name="Встроенные переменные"> + +<para> +<list type="tag"> + +<tag-name id="var_realip_remote_addr"><var>$realip_remote_addr</var></tag-name> +<tag-desc> +хранит исходный адрес клиента +</tag-desc> + +<tag-name id="var_realip_remote_port"><var>$realip_remote_port</var></tag-name> +<tag-desc> +хранит исходный порт клиента +</tag-desc> + +</list> +</para> + +</section> + +</module>