From ccae8bcc69d5ea3f682cbb98ca6db154381e150c Mon Sep 17 00:00:00 2001 From: Arik Fraimovich Date: Mon, 11 Jan 2016 12:02:18 +0200 Subject: [PATCH] Add option to override # of proxies --- redash/settings.py | 1 + redash/wsgi.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/redash/settings.py b/redash/settings.py index e1d2306f..236cd152 100644 --- a/redash/settings.py +++ b/redash/settings.py @@ -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")) diff --git a/redash/wsgi.py b/redash/wsgi.py index f8481aa5..c71485f3 100644 --- a/redash/wsgi.py +++ b/redash/wsgi.py @@ -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)