diff --git a/logs_collector/gunicorn.conf.py b/logs_collector/gunicorn.conf.py index 5b9e279..6ebe389 100644 --- a/logs_collector/gunicorn.conf.py +++ b/logs_collector/gunicorn.conf.py @@ -9,19 +9,17 @@ from logs_collector.settings import BASE_DIR # https://docs.gunicorn.org/en/stable/settings.html # https://github.com/benoitc/gunicorn/blob/master/examples/example_config.py -# hide web server name: -gunicorn.SERVER = 'undisclosed' - env = environ.Env( # set casting, default value: + GUNICORN_SERVER_NAME=(str, 'undisclosed'), GUNICORN_BIND=(str, '0.0.0.0:8000'), GUNICORN_BACKLOG=(int, 2048), GUNICORN_WORKERS=(int, 2), - GUNICORN_WORKER_CLASS=(str, 'gthread'), + GUNICORN_WORKER_CLASS=(str, 'sync'), GUNICORN_WORKER_CONNECTIONS=(int, 1000), - GUNICORN_THREADS=(int, 1), - GUNICORN_TIMEOUT=(int, 30), + GUNICORN_THREADS=(int, 2), + GUNICORN_TIMEOUT=(int, 3600), GUNICORN_KEEPALIVE=(int, 2), GUNICORN_LOGLEVEL=(str, 'info'), @@ -29,6 +27,9 @@ env = environ.Env( environ.Env.read_env(BASE_DIR / '.env') +# Server name: +gunicorn.SERVER = env('GUNICORN_SERVER_NAME') + # Server socket: bind = env('GUNICORN_BIND') backlog = env('GUNICORN_BACKLOG') @@ -45,4 +46,4 @@ keepalive = env('GUNICORN_KEEPALIVE') loglevel = env('GUNICORN_LOGLEVEL') errorlog = '-' accesslog = '-' -access_log_format = '%(h)s %(l)s %(u)s %(t)s "%(r)s" %(s)s %(b)s "%(f)s" "%(a)s"' # noqa:E501 +access_log_format = '%({X-Forwarded-For}i)s %(l)s %(u)s %(t)s "%(r)s" %(s)s %(b)s "%(f)s" "%(a)s"' # noqa:E501