Open stateless opened 4 years ago
Ping.
Here is the patch code:
diff --git a/management/web_update.py b/management/web_update.py
index 72295c2..27e6efc 100644
--- a/management/web_update.py
+++ b/management/web_update.py
@@ -156,8 +156,12 @@ def make_domain_config(domain, templates, ssl_certificates, env):
# any proxy or redirect here?
for path, url in yaml.get("proxies", {}).items():
nginx_conf_extra += "\tlocation %s {" % path
- nginx_conf_extra += "\n\t\tproxy_pass %s;" % url
+ nginx_conf_extra += "\n\t\tproxy_set_header Host $http_host;"
+ nginx_conf_extra += "\n\t\tproxy_set_header X-Real-IP $remote_addr;"
nginx_conf_extra += "\n\t\tproxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;"
+ nginx_conf_extra += "\n\t\tproxy_set_header X-Forwarded-Host $http_host;"
+ nginx_conf_extra += "\n\t\tproxy_set_header X-Forwarded-Proto $scheme;"
+ nginx_conf_extra += "\n\t\tproxy_pass %s;" % url
nginx_conf_extra += "\n\t}\n"
for path, url in yaml.get("redirects", {}).items():
nginx_conf_extra += "\trewrite %s %s permanent;\n" % (path, url)
@JoshData
Please see pull request: #1432
Also: https://discourse.mailinabox.email/t/reverse-proxy-bug-due-to-configuration-scope-issues/3745