uwsgi配置
官方文档 : uwsgi-docs
| 选项 | 描述 |
|---|---|
| chdir | the base directory (full path) |
| module | Django's wsgi file |
| master | 启动管理主进程 |
| processes | 启动的进程数 |
| threads | 每个进程的线程数 |
| uid | 启动uwsgi的用户 |
| gid | 启动uwsgi的用户组 |
| pidfile | 进程号文件 |
| max-requests | 最大请求数 |
| vacuum | clear environment on exit 服务停止自动清理sock文件和pid文件 |
| daemonize | 日志目录 |
| home | python虚拟环境路径 |
| socket | scoket地址(tcp或者sock文件路径) |
| chmod-socket | sock文件权限 |
| http | uwsgi监听IP和端口 |
x
[uwsgi]chdir=/opt/Platformmodule=Platform.wsgimaster=Truepidfile=/tmp/tzop.pidvacuum=Truemax-requests=5000processes=8#socket=/var/run/op_uwsgi.sock# unxi scoket need set chmod-socket#chmod-socket=666#socket=127.0.0.1:8000http=127.0.0.1:8000#static-map = /static=/application/Platform/staticdaemonize=/opt/Platform/logs/uwsgi.log启动
x
uwsgi --ini tzop.ini停止
x
uwsgi --stop /tmp/tzop.pid重载
x
uwsgi --reload /tmp/tzop.pidnginx配置
uwsgi_pass 不对 location 目录转发
x
server { listen 80; server_name _ ;
location / { root /opt/Platform; try_files $uri $uri/ /index.html; }
location /api/ { proxy_pass http://127.0.0.1:8000/; #uwsgi_pass 127.0.0.1:8000; #uwsgi_pass unix:///var/run/op_uwsgi.sock; #include /etc/nginx/uwsgi_params; }}
评论
发表评论