diff --git a/templates/nginx-proxy-params.conf.j2 b/templates/nginx-proxy-params.conf.j2 index 30df3e3..ea32c99 100644 --- a/templates/nginx-proxy-params.conf.j2 +++ b/templates/nginx-proxy-params.conf.j2 @@ -2,19 +2,19 @@ # include /etc/nginx/snippets/nginx-proxy-params.conf; proxy_http_version 1.1; proxy_set_header Connection ""; -{% if nginx_behind_haproxy_settings %} {% if haproxy_ips is defined %} proxy_set_header Host $http_host; +{% if nginx_behind_haproxy_settings %} proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-Host {{ nginx_x_forwarded_host }}; proxy_set_header X-Forwarded-Server $host; +{% endif %} {% else %} proxy_set_header Host $host; {% if nginx_define_x_real_ip %} proxy_set_header X-Real-IP $remote_addr; {% endif %} {% endif %} -{% endif %} {% if nginx_set_original_uri %} proxy_set_header nginx-request-uri $request_uri; {% endif %}