Instead of $remote_addr. This gives a chain of remote addresses if we
have multiple layers of proxies [1]:
$proxy_add_x_forwarded_for
Contains client request-header "X-Forwarded-For" with separated by
comma $remote_addr. If there is no X-Forwarded-For request-header,
than $proxy_add_x_forwarded_for is equal to $remote_addr.
[1]: http://wiki.nginx.org/HttpProxyModule#.24proxy_add_x_forwarded_for
location / {
proxy_pass ${URL};
- proxy_set_header X-Forwarded-For $remote_addr;
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}