uWSGI 配置:
[uwsgi]
chdir = /home/admin/project_name ##项目地址
module = project_name.wsgi:application ## managy.py同级目录下的wsgi文件
processes = 4
threads = 2
socket=/home/admin/project_name/uwsgi.sock #配合nginx时 配置socket
#http = 127.0.0.1:8021 # 单独使用,配置http
pidfile = /var/run/uwsgi.pid #进程id
daemonize = /var/log/uwsgi.log #日志
master = true
buffer-size=65536
vacuum = true #退出时清理环境。
Nginx 配置:
server{
listen 8081; #监听的端口号
server_name 10.200.11.208; #URL
charset utf-8;
access_log /var/log/nginx/nginx_access.log;
error_log /var/log/nginx/nginx_error.log;
client_max_body_size 75M;
location / {
include uwsgi_params;
uwsgi_pass unix:/home/admin/project_name/uwsgi.sock; #和uwsgi里的sock的配置一致
uwsgi_read_timeout 20;
}
}