fix: resolve login network error behind Traefik proxy
This commit is contained in:
6
app.py
6
app.py
@@ -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)
|
||||
Reference in New Issue
Block a user