2022-10-30 14:19:44 +00:00
|
|
|
import socket
|
2022-10-30 12:14:16 +00:00
|
|
|
|
2022-07-28 14:53:22 +01:00
|
|
|
import gunicorn
|
|
|
|
|
|
|
|
wsgi_app = "website.wsgi:application"
|
|
|
|
accesslog = "-"
|
|
|
|
disable_redirect_access_to_syslog = True
|
|
|
|
preload_app = True
|
|
|
|
bind = "0.0.0.0"
|
2022-08-30 21:38:12 +01:00
|
|
|
max_requests = 1200
|
|
|
|
max_requests_jitter = 100
|
2022-07-28 14:53:22 +01:00
|
|
|
|
2022-09-06 08:36:55 +01:00
|
|
|
# Run an additional thread so the GIL isn't sitting completely idle
|
|
|
|
threads = 2
|
|
|
|
|
2022-07-28 14:53:22 +01:00
|
|
|
# Replace gunicorn's 'Server' HTTP header
|
2022-08-30 08:48:16 +01:00
|
|
|
gunicorn.SERVER_SOFTWARE = gunicorn.SERVER = "Wouldn't you like to know"
|
2022-10-30 12:14:16 +00:00
|
|
|
|
2022-10-30 14:19:44 +00:00
|
|
|
# HACK: Allow traefik to send forwarded IPs
|
|
|
|
# CIDR isn't supported here sadly
|
|
|
|
try:
|
|
|
|
forwarded_allow_ips = socket.gethostbyname("traefik")
|
|
|
|
except socket.gaierror:
|
|
|
|
pass
|