Reverse Proxy Changes
This commit is contained in:
parent
905e3c3977
commit
b46ec98115
3
app.py
3
app.py
@ -20,11 +20,14 @@ import atexit
|
|||||||
from flask_limiter import Limiter
|
from flask_limiter import Limiter
|
||||||
from flask_limiter.util import get_remote_address
|
from flask_limiter.util import get_remote_address
|
||||||
import secrets
|
import secrets
|
||||||
|
from werkzeug.middleware.proxy_fix import ProxyFix
|
||||||
|
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
app.secret_key = os.urandom(24)
|
app.secret_key = os.urandom(24)
|
||||||
config = load_or_create_config()
|
config = load_or_create_config()
|
||||||
|
|
||||||
|
app.wsgi_app = ProxyFix(app.wsgi_app, x_for=1, x_proto=1, x_host=1, x_prefix=1)
|
||||||
|
|
||||||
UPLOAD_FOLDER = config['directories']['upload']
|
UPLOAD_FOLDER = config['directories']['upload']
|
||||||
THUMBNAIL_FOLDER = config['directories']['thumbnail']
|
THUMBNAIL_FOLDER = config['directories']['thumbnail']
|
||||||
ALLOWED_EXTENSIONS = {'jpg', 'jpeg', 'png', 'gif'}
|
ALLOWED_EXTENSIONS = {'jpg', 'jpeg', 'png', 'gif'}
|
||||||
|
Loading…
Reference in New Issue
Block a user