diff --git a/nginx/templates/nginx-proxy-params.conf.j2 b/nginx/templates/nginx-proxy-params.conf.j2 index 68ffc909..f8cb3b00 100644 --- a/nginx/templates/nginx-proxy-params.conf.j2 +++ b/nginx/templates/nginx-proxy-params.conf.j2 @@ -1,10 +1,14 @@ # Proxy stuff # include /etc/nginx/snippets/nginx-proxy-params.conf; proxy_http_version 1.1; +{% if haproxy_ips is defined %} proxy_set_header Host $http_host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-Host $remote_addr; proxy_set_header X-Forwarded-Server $host; +{% else %} +proxy_set_header Host $host; +{% endif %} proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_buffering {{ nginx_proxy_buffering }};