From: W. Trevor King Date: Fri, 10 Jan 2014 03:41:12 +0000 (-0800) Subject: nginx-proxy/vhost-template.conf: Use $proxy_add_x_forwarded_for X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=2445bcfba3e2374eb8507f8d56db3ddd8e5ae212;p=dockerfile.git nginx-proxy/vhost-template.conf: Use $proxy_add_x_forwarded_for 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 --- diff --git a/nginx-proxy/vhost-template.conf b/nginx-proxy/vhost-template.conf index 77c403e..008ee2c 100644 --- a/nginx-proxy/vhost-template.conf +++ b/nginx-proxy/vhost-template.conf @@ -38,6 +38,6 @@ server { location / { proxy_pass ${URL}; - proxy_set_header X-Forwarded-For $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } }