Improve X-Forwarded-Host support

This commit is contained in:
Manuel de Brito Fontes 2017-06-27 10:08:14 -04:00
parent 1468fcb1aa
commit 5f02858623

View file

@ -169,11 +169,16 @@ http {
}
# Obtain best http host
map $http_host $best_http_host {
map $http_host $this_host {
default $http_host;
'' $host;
}
map $http_x_forwarded_host $best_http_host {
default $http_x_forwarded_host;
'' $this_host;
}
server_name_in_redirect off;
port_in_redirect off;