From a669867099ff76888141cee9332c1e5bc8171377 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Thu, 11 Feb 2016 18:25:20 -0500 Subject: [PATCH] $FORWARDED_ALLOW_IPS --- gunicorn/config.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gunicorn/config.py b/gunicorn/config.py index ec26426cd..8699e82e0 100644 --- a/gunicorn/config.py +++ b/gunicorn/config.py @@ -1014,14 +1014,17 @@ class ForwardedAllowIPS(Setting): cli = ["--forwarded-allow-ips"] meta = "STRING" validator = validate_string_to_list - default = "127.0.0.1" + default = os.environ.get("FORWARDED_ALLOW_IPS", "127.0.0.1") desc = """\ Front-end's IPs from which allowed to handle set secure headers. (comma separate). Set to ``*`` to disable checking of Front-end IPs (useful for setups where you don't know in advance the IP address of Front-end, but - you still trust the environment) + you still trust the environment). + + By default, the value of the ``FORWARDED_ALLOW_IPS`` environment + variable. If it is not defined, the default is ``"127.0.0.1"``. """