'real_ip_header proxy_protocol' don't change the client address

fengx nginx-forum at forum.nginx.org
Thu Sep 28 02:38:45 UTC 2017


The config is rather simple as following. My test version is 1.7.2, a bit
old. I can't upgrade to the latest one in our production for now. Anyway I
think it should work in 1.7.2 because the document says proxy_protocol was
introduced from 1.5.12.

http {
    log_format combined '$proxy_protocol_addr - $remote_addr - $remote_user
[$time_local] '
                        '"$request" $status $body_bytes_sent '
                        '"$http_referer" "$http_user_agent"';
    ...

    server {
        server_name www.abc.com;

        listen 80;
        listen 8181 proxy_protocol;

        real_ip_header   proxy_protocol;
        real_ip_recursive on;
        set_real_ip_from 192.168.1.0/24;

        location / {
            ...
        }
    }
}

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,276542,276590#msg-276590



More information about the nginx mailing list