← Back to team overview

sts-sponsors team mailing list archive

[Merge] ~troyanov/maas:proxy-headers into maas:master

 

Anton Troyanov has proposed merging ~troyanov/maas:proxy-headers into maas:master.

Commit message:
fix(region): use $http_host to read Host header
    
$http_name
arbitrary request header field;
    
the last part of a variable name is the field name converted to lower case
with dashes replaced by underscores

Resolves LP:2009186

Requested reviews:
  MAAS Maintainers (maas-maintainers)

For more details, see:
https://code.launchpad.net/~troyanov/maas/+git/maas/+merge/438884
-- 
Your team MAAS Maintainers is requested to review the proposed merge of ~troyanov/maas:proxy-headers into maas:master.
diff --git a/src/maasserver/templates/http/regiond.nginx.conf.template b/src/maasserver/templates/http/regiond.nginx.conf.template
index 650e1b4..bf0cc8b 100644
--- a/src/maasserver/templates/http/regiond.nginx.conf.template
+++ b/src/maasserver/templates/http/regiond.nginx.conf.template
@@ -7,11 +7,11 @@ upstream regiond-webapp {
 proxy_http_version 1.1;
 proxy_buffering off;
 proxy_read_timeout 900s; # to match the Twisted one
-proxy_set_header Host $host;
+proxy_set_header Host $http_host;
 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-Host $host:$server_port;
+proxy_set_header X-Forwarded-Host $http_host;
 
 server {
     {{if tls_enabled}}

Follow ups