add ProxyFix to get a IP behind a proxy server
This commit is contained in:
parent
a2b322f868
commit
d8f914f370
1 changed files with 2 additions and 0 deletions
2
fhost.py
2
fhost.py
|
@ -43,8 +43,10 @@ import secrets
|
||||||
import re
|
import re
|
||||||
from validators import url as url_valid
|
from validators import url as url_valid
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
from werkzeug.middleware.proxy_fix import ProxyFix
|
||||||
|
|
||||||
app = Flask(__name__, instance_relative_config=True)
|
app = Flask(__name__, instance_relative_config=True)
|
||||||
|
app.wsgi_app = ProxyFix(app.wsgi_app, x_for=1)
|
||||||
app.config.update(
|
app.config.update(
|
||||||
SQLALCHEMY_TRACK_MODIFICATIONS=False,
|
SQLALCHEMY_TRACK_MODIFICATIONS=False,
|
||||||
PREFERRED_URL_SCHEME="https", # nginx users: make sure to have
|
PREFERRED_URL_SCHEME="https", # nginx users: make sure to have
|
||||||
|
|
Loading…
Add table
Reference in a new issue