From cdfb6bf3e3084b7c8fabeb1e8951ed7a769d0134 Mon Sep 17 00:00:00 2001 From: Josh Max Date: Wed, 3 Apr 2019 01:25:29 -0700 Subject: [PATCH] Use HTTP_X_FORWARDED_HOST instead of HTTP_X_FORWARDED_SERVER Use HTTP_X_FORWARDED_HOST since HTTP_X_FORWARDED_SERVER holds the hostname of the proxy server on HAProxy/Traefik. --- cps/reverseproxy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cps/reverseproxy.py b/cps/reverseproxy.py index 5e2ce271..3fc9d600 100644 --- a/cps/reverseproxy.py +++ b/cps/reverseproxy.py @@ -49,7 +49,7 @@ class ReverseProxied(object): scheme = environ.get('HTTP_X_SCHEME', '') if scheme: environ['wsgi.url_scheme'] = scheme - servr = environ.get('HTTP_X_FORWARDED_SERVER', '') + servr = environ.get('HTTP_X_FORWARDED_HOST', '') if servr: environ['HTTP_HOST'] = servr return self.app(environ, start_response)