Add option to override # of proxies

This commit is contained in:
Arik Fraimovich 2016-01-11 12:02:18 +02:00
parent 07f96a22af
commit ccae8bcc69
2 changed files with 2 additions and 1 deletions

View File

@ -55,6 +55,7 @@ def all_settings():
NAME = os.environ.get('REDASH_NAME', 're:dash')
REDIS_URL = os.environ.get('REDASH_REDIS_URL', "redis://localhost:6379/0")
PROXIES_COUNT = int(os.environ.get('REDASH_PROXIES_COUNT', "1"))
STATSD_HOST = os.environ.get('REDASH_STATSD_HOST', "127.0.0.1")
STATSD_PORT = int(os.environ.get('REDASH_STATSD_PORT', "8125"))

View File

@ -30,7 +30,7 @@ app = Flask(__name__,
static_path='/static')
# Make sure we get the right referral address even behind proxies like nginx.
app.wsgi_app = ProxyFix(app.wsgi_app)
app.wsgi_app = ProxyFix(app.wsgi_app, settings.PROXIES_COUNT)
app.url_map.converters['org_slug'] = SlugConverter
provision_app(app)