mirror of
https://github.com/ail-project/ail-framework.git
synced 2025-01-18 16:36:13 +00:00
chg: [flask] set proxy ProxyFix
This commit is contained in:
parent
d0f4247c2b
commit
80c7410cb1
1 changed files with 4 additions and 0 deletions
|
@ -13,6 +13,7 @@ import logging.config
|
||||||
from flask import Flask, render_template, jsonify, request, Request, Response, session, redirect, url_for
|
from flask import Flask, render_template, jsonify, request, Request, Response, session, redirect, url_for
|
||||||
from flask_login import LoginManager, current_user, login_user, logout_user, login_required
|
from flask_login import LoginManager, current_user, login_user, logout_user, login_required
|
||||||
from flask_sock import Sock
|
from flask_sock import Sock
|
||||||
|
from werkzeug.middleware.proxy_fix import ProxyFix
|
||||||
|
|
||||||
sys.path.append(os.environ['AIL_BIN'])
|
sys.path.append(os.environ['AIL_BIN'])
|
||||||
##################################
|
##################################
|
||||||
|
@ -180,6 +181,9 @@ def list_len(s):
|
||||||
|
|
||||||
app.jinja_env.filters['list_len'] = list_len
|
app.jinja_env.filters['list_len'] = list_len
|
||||||
|
|
||||||
|
# ========= PROXY ========
|
||||||
|
app.wsgi_app = ProxyFix(app.wsgi_app, x_for=1)
|
||||||
|
|
||||||
|
|
||||||
# ========= CACHE CONTROL ========
|
# ========= CACHE CONTROL ========
|
||||||
@app.after_request
|
@app.after_request
|
||||||
|
|
Loading…
Add table
Reference in a new issue