mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
proxy_allow_ips: Allow proxy protocol if "*" specified.
This makes proxy_allow_ips symmetrical with forwarded_allow_ips and is useful in the same situations.
This commit is contained in:
parent
69ab24b589
commit
9d9e547316
@ -1403,6 +1403,10 @@ class ProxyAllowFrom(Setting):
|
|||||||
default = "127.0.0.1"
|
default = "127.0.0.1"
|
||||||
desc = """\
|
desc = """\
|
||||||
Front-end's IPs from which allowed accept proxy requests (comma separate).
|
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)
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -252,7 +252,8 @@ class Request(Message):
|
|||||||
if e.args[0] == ENOTCONN:
|
if e.args[0] == ENOTCONN:
|
||||||
raise ForbiddenProxyRequest("UNKNOW")
|
raise ForbiddenProxyRequest("UNKNOW")
|
||||||
raise
|
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)
|
raise ForbiddenProxyRequest(remote_host)
|
||||||
|
|
||||||
def parse_proxy_protocol(self, line):
|
def parse_proxy_protocol(self, line):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user