fix(proxy): specify Forwarded headers in ProxyFix

Updated the ProxyFix middleware configuration to explicitly include Forwarded headers for IP address, protocol, host, and port. This enhances reliability of request data handling when the app is behind a reverse proxy, ensuring correct client information is passed to the app.
This commit is contained in:
Kumi 2024-09-27 07:26:02 +02:00
parent e3eba93f4e
commit bf512f5e07
Signed by: kumi
GPG key ID: ECBCC9082395383F

View file

@ -20,7 +20,7 @@ def main():
app.debug = True
if int(environ.get("PROXY_FIX", 0)):
app.wsgi_app = ProxyFix(app.wsgi_app)
app.wsgi_app = ProxyFix(app.wsgi_app, x_for=1, x_proto=1, x_host=1, x_port=1)
app.run(port=port)