mirror of
https://git.ari.lt/ari.lt/ari.lt.git
synced 2025-02-05 01:59:25 +01:00
add proxy fix
Signed-off-by: Ari Archer <ari@ari.lt>
This commit is contained in:
parent
0a9d662db7
commit
331b53ca86
1 changed files with 2 additions and 0 deletions
|
@ -9,6 +9,7 @@ from base64 import b64encode
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
import flask
|
import flask
|
||||||
|
from werkzeug.middleware.proxy_fix import ProxyFix
|
||||||
|
|
||||||
from . import util
|
from . import util
|
||||||
|
|
||||||
|
@ -22,6 +23,7 @@ def create_app(name: str) -> flask.Flask:
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
app: flask.Flask = flask.Flask(name)
|
app: flask.Flask = flask.Flask(name)
|
||||||
|
app.wsgi_app = ProxyFix(app.wsgi_app, x_for=1, x_proto=1) # type: ignore
|
||||||
|
|
||||||
app.config["PREFERRED_URL_SCHEME"] = "http" if app.debug else "https"
|
app.config["PREFERRED_URL_SCHEME"] = "http" if app.debug else "https"
|
||||||
app.config["DOMAIN"] = "ari.lt"
|
app.config["DOMAIN"] = "ari.lt"
|
||||||
|
|
Loading…
Add table
Reference in a new issue