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 proxy_protocol parameter in the listen
directive.
This module is not built by default, it should be enabled with the --with-stream_realip_module
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;
Syntax: | set_real_ip_from
address |
CIDR |
unix:; |
---|---|
Default: | — |
Context: | stream , server |
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.
$realip_remote_addr
$realip_remote_port
© 2002-2019 Igor Sysoev
© 2011-2019 Nginx, Inc.
Licensed under the BSD License.
https://nginx.org/en/docs/stream/ngx_stream_realip_module.html