From 75e21a2e2e74d0c7aec085229f31cc80aa70f986 Mon Sep 17 00:00:00 2001 From: nd Date: Fri, 29 Jan 2021 18:58:33 +0100 Subject: [PATCH] add support to remove proxy headers --- templates/vhost.conf.j2 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/templates/vhost.conf.j2 b/templates/vhost.conf.j2 index c21b80a..5a3f16c 100644 --- a/templates/vhost.conf.j2 +++ b/templates/vhost.conf.j2 @@ -39,7 +39,7 @@ server { proxy_set_header X-Forwarded-Ssl $https; proxy_set_header X-Url-Scheme $scheme; - # custom proxy headers + # add custom proxy headers {% for header in vhost.add_proxy_headers|d({}) if header %} proxy_set_header {{ header }} "{{ vhost.add_proxy_headers[header] }}"; {% endfor %} @@ -49,6 +49,10 @@ server { proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; + # remove custom proxy headers +{% for header in vhost.hide_proxy_headers|d({}) if header %} + proxy_hide_header {{ header }}; +{% endfor %} # hide downstream headers for security reasons proxy_hide_header X-Powered-By; proxy_hide_header Server;