123456789101112131415161718192021222324252627 |
- # -*- coding: utf-8 -*-
- """
- Created on 2023-04-24
- ---------
- @summary: gunicorn配置
- ---------
- @author: Dzr
- """
- import multiprocessing
- # 服务地址
- bind = '0.0.0.0:2119'
- # 代码更改时重新启动工作程序(适用于开发测试)
- reload = False
- # 日志输出级别
- loglevel = 'info'
- # 访问记录到标准输出
- accesslog = '-'
- # 访问记录格式
- access_log_format = '%({x-forwarded-for}i)s %(l)s %(u)s %(t)s "%(r)s" %(s)s %(b)s "%(f)s" "%(a)s"'
- # 工作进程数量
- workers = multiprocessing.cpu_count() * 2 + 1
- # 工作模式
- worker_class = 'uvicorn.workers.UvicornWorker'
- # 转发白名单
- forwarded_allow_ips = '*'
|