Add nginx X-Forwarded-Port and X-Forwarded-Host (#2237)

Some applications as Keycloak when running behind Nginx proxy need these flags configured 

proxy_set_header X-Forwarded-Port $server_port;
proxy_set_header X-Forwarded-Host $host;

This cause no impact in other applications already configured, at least for my applications
This commit is contained in:
Carlos Cesario
2021-04-10 10:32:49 +02:00
committed by GitHub
parent f7fda26ebb
commit 29529a33ba
@@ -153,6 +153,8 @@ location {{ location.matchtype }} {{ location.urlpattern }} {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Port $server_port;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-TLS-Client-Intercepted $tls_intercepted;
{% if location.proxy_read_timeout is defined and location.proxy_read_timeout != '' %}
proxy_read_timeout {{ location.proxy_read_timeout }}s;