nginx-proxy/vhost-template.conf: Use $proxy_add_x_forwarded_for
authorW. Trevor King <wking@tremily.us>
Fri, 10 Jan 2014 03:41:12 +0000 (19:41 -0800)
committerW. Trevor King <wking@tremily.us>
Fri, 10 Jan 2014 03:41:12 +0000 (19:41 -0800)
commit2445bcfba3e2374eb8507f8d56db3ddd8e5ae212
treeff28941179a77ba619a14fdfaf66a79fdc2f84ae
parentf70f6a18df7ff34c2f3817a182611ab1b7d16ac3
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