fix: Add proxy aware to flask
All checks were successful
Check Code Quality / RuffCheck (push) Successful in 1m5s
Build Docker / BuildImage (push) Successful in 1m29s

This commit is contained in:
2026-02-11 14:39:52 +11:00
parent 6efc480e70
commit 4836b5fb81

View File

@@ -10,6 +10,7 @@ from flask import (
url_for, url_for,
) )
from werkzeug.exceptions import InternalServerError from werkzeug.exceptions import InternalServerError
from werkzeug.middleware.proxy_fix import ProxyFix
import os import os
import json import json
import requests import requests
@@ -22,6 +23,7 @@ dotenv.load_dotenv()
app = Flask(__name__) app = Flask(__name__)
app.secret_key = os.getenv("APP_SECRET_KEY", os.urandom(24)) app.secret_key = os.getenv("APP_SECRET_KEY", os.urandom(24))
app.wsgi_app = ProxyFix(app.wsgi_app, x_proto=1, x_host=1)
# Cache Configuration # Cache Configuration
cache = Cache(app, config={'CACHE_TYPE': 'SimpleCache', 'CACHE_DEFAULT_TIMEOUT': 300}) cache = Cache(app, config={'CACHE_TYPE': 'SimpleCache', 'CACHE_DEFAULT_TIMEOUT': 300})