diff --git a/gunicorn/config.py b/gunicorn/config.py index e61bb2c0..e1c73094 100644 --- a/gunicorn/config.py +++ b/gunicorn/config.py @@ -1403,6 +1403,10 @@ class ProxyAllowFrom(Setting): default = "127.0.0.1" desc = """\ Front-end's IPs from which allowed accept proxy requests (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) """ diff --git a/gunicorn/http/message.py b/gunicorn/http/message.py index a82ba5a8..6b768598 100644 --- a/gunicorn/http/message.py +++ b/gunicorn/http/message.py @@ -252,7 +252,8 @@ class Request(Message): if e.args[0] == ENOTCONN: raise ForbiddenProxyRequest("UNKNOW") raise - if remote_host not in self.cfg.proxy_allow_ips: + if ("*" not in self.cfg.proxy_allow_ips and + remote_host not in self.cfg.proxy_allow_ips): raise ForbiddenProxyRequest(remote_host) def parse_proxy_protocol(self, line):