set_real_ip_from, real_ip_header directive in ngx_http_realip_module

foxgab nginx-forum at
Thu Jun 29 13:08:40 UTC 2017

if nginx is behind another proxy, that proxy set the X-Forwarded-for header
with the real client ip, and the configration of nginx is :

location / {
proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
real_ip_header    X-Forwarded-For;

whether the real client ip or the address of the proxy will add in the
X-Forwarded-For header?
will the value of $remote_addr changes only after real_ip_header directive
or at the beginning of the context?

Posted at Nginx Forum:,272653,275206#msg-275206

More information about the nginx mailing list