fix: resolve login network error behind Traefik proxy

This commit is contained in:
Ashim Kumar
2026-02-20 15:20:03 +06:00
parent 8e02b9ad09
commit 4789771836
3 changed files with 23 additions and 10 deletions

6
app.py
View File

@@ -16,11 +16,9 @@ def create_app():
app.secret_key = SECRET_KEY
app.config['SESSION_COOKIE_HTTPONLY'] = True
app.config['SESSION_COOKIE_SAMESITE'] = 'Lax'
app.config['SESSION_COOKIE_SECURE'] = os.getenv('FLASK_ENV') == 'production'
app.config['PERMANENT_SESSION_LIFETIME'] = 86400 # 24 hours
app.config['PREFERRED_URL_SCHEME'] = 'https'
# Trust the reverse proxy headers from Coolify/Traefik
# Behind Coolify/Traefik: trust proxy headers
from werkzeug.middleware.proxy_fix import ProxyFix
app.wsgi_app = ProxyFix(app.wsgi_app, x_for=1, x_proto=1, x_host=1, x_prefix=1)
@@ -53,4 +51,4 @@ if __name__ == '__main__':
print("=" * 60)
app.run(debug=True, port=5009)
app.run(debug=True, port=5009)