added environment variables for ProxyFix

This commit is contained in:
Alok Saldanha
2021-02-13 16:42:34 -05:00
parent 01dccef7db
commit f1f4b0c0ca
5 changed files with 41 additions and 20 deletions
+15 -1
View File
@@ -50,7 +50,21 @@ def _force_https(app):
app.wsgi_app = _force_https(app.wsgi_app)
app.wsgi_app = ProxyFix(app.wsgi_app, x_proto=1, x_host=1, x_prefix=1)
if (
env.proxy_fix_for > 0
or env.proxy_fix_proto > 0
or env.proxy_fix_host > 0
or env.proxy_fix_port > 0
or env.proxy_fix_prefix > 0
):
app.wsgi_app = ProxyFix(
app.wsgi_app,
x_for=env.proxy_fix_for,
x_proto=env.proxy_fix_proto,
x_host=env.proxy_fix_host,
x_port=env.proxy_fix_port,
x_prefix=env.proxy_fix_prefix,
)
cache = BackendCache()