Allow gunicorn to use X-Forwarded-*
header
This commit is contained in:
parent
2e4e54418d
commit
1023c821ab
1 changed files with 6 additions and 0 deletions
|
@ -1,3 +1,5 @@
|
|||
import os
|
||||
|
||||
import gunicorn
|
||||
|
||||
wsgi_app = "website.wsgi:application"
|
||||
|
@ -13,3 +15,7 @@ threads = 2
|
|||
|
||||
# Replace gunicorn's 'Server' HTTP header
|
||||
gunicorn.SERVER_SOFTWARE = gunicorn.SERVER = "Wouldn't you like to know"
|
||||
|
||||
# Allow `X-Forwarded-*` headers from specific IPs
|
||||
if "FORWARDED_ALLOW_IPS" in os.environ:
|
||||
forwarded_allow_ips = os.environ["FORWARDED_ALLOW_IPS"]
|
||||
|
|
Loading…
Reference in a new issue