From 437d0a0b1e2dd0f45eacd329a8105395fc7c9aa3 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Mon, 3 May 2021 19:10:21 +0200 Subject: [PATCH] Limit the entries skipped by nginx_behind_haproxy_settings --- templates/nginx-proxy-params.conf.j2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 %}