Skip to content

Commit

Permalink
Merge pull request #911 from aledbf/fix-forwarder-host
Browse files Browse the repository at this point in the history
Improve X-Forwarded-Host support
  • Loading branch information
aledbf authored Jun 27, 2017
2 parents 1468fcb + 5f02858 commit 05e4600
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion controllers/nginx/rootfs/etc/nginx/template/nginx.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 05e4600

Please sign in to comment.