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.
This commit is contained in:
parent
4b301a7961
commit
cdfb6bf3e3
|
@ -49,7 +49,7 @@ class ReverseProxied(object):
|
||||||
scheme = environ.get('HTTP_X_SCHEME', '')
|
scheme = environ.get('HTTP_X_SCHEME', '')
|
||||||
if scheme:
|
if scheme:
|
||||||
environ['wsgi.url_scheme'] = scheme
|
environ['wsgi.url_scheme'] = scheme
|
||||||
servr = environ.get('HTTP_X_FORWARDED_SERVER', '')
|
servr = environ.get('HTTP_X_FORWARDED_HOST', '')
|
||||||
if servr:
|
if servr:
|
||||||
environ['HTTP_HOST'] = servr
|
environ['HTTP_HOST'] = servr
|
||||||
return self.app(environ, start_response)
|
return self.app(environ, start_response)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user