Fix mixed content: ProxyFix for HTTPS behind nginx, set PREFERRED_URL_SCHEME=https

This commit is contained in:
eric 2026-02-23 08:56:50 +00:00
parent 595451428a
commit 58fcddbff1

5
app.py
View file

@ -423,6 +423,11 @@ AGENT_KEYWORDS = {
app.secret_key = os.getenv('SECRET_KEY', 'agent-orchestration-secret-key-2026')
app.config['UPLOAD_FOLDER'] = 'uploads'
app.config['MAX_CONTENT_LENGTH'] = 16 * 1024 * 1024
app.config['PREFERRED_URL_SCHEME'] = 'https'
# Hinter nginx: X-Forwarded-Proto auswerten damit Flask HTTPS-URLs generiert
from werkzeug.middleware.proxy_fix import ProxyFix
app.wsgi_app = ProxyFix(app.wsgi_app, x_proto=1, x_host=1)
app.permanent_session_lifetime = timedelta(days=7)
# ── App Password ─────────────────────────────────────────────────────────────