Files
nginxserver/nginx-python-api/gunicorn_config.py
2026-07-16 13:03:11 +08:00

30 lines
484 B
Python

"""
Gunicorn 生产环境配置文件
用法: gunicorn -c gunicorn_config.py app:app
"""
import os
# 监听地址和端口
bind = "0.0.0.0:5000"
# Worker 进程数
workers = int(os.environ.get('GUNICORN_WORKERS', 2))
# Worker 类型
worker_class = "sync"
# 超时
timeout = 60
graceful_timeout = 10
# 日志
accesslog = "-" # 标准输出
errorlog = "-" # 标准错误
loglevel = "info"
# 进程名称
proc_name = "nginx-manager-api"
# 后台运行
daemon = False