From 2445bcfba3e2374eb8507f8d56db3ddd8e5ae212 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Thu, 9 Jan 2014 19:41:12 -0800 Subject: [PATCH] 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 --- nginx-proxy/vhost-template.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } } -- 2.26.2