1.Nginx配置
server
{
listen 80;
server_name 域名地址;
location / {
uwsgi_pass 0.0.0.0:4563;// 运行地址
include uwsgi_params;
}
location /static{ // 静态文件路径
alias /www/wwwroot/djserverproject/static;
}
}
server
{
listen 443;
server_name 域名地址;
ssl_certificate /www/server/panel/vhost/cert/djserverproject/fullchain.pem;
ssl_certificate_key /www/server/panel/vhost/cert/djserverproject/privkey.pem;
location / {
uwsgi_pass 0.0.0.0:4563;// 运行地址
include uwsgi_params;
}
location /static{
alias /www/wwwroot/djserverproject/static;
}
}
2.Nginx转发的uwsgi编写
[uwsgi]
chdir=/www/wwwroot/djserverproject
wsgi-file=/www/wwwroot/djserverproject/djProject/wsgi.py
callable=application
processes=4
threads=2
pidfile=/www/wwwroot/djserverproject/uwsgi.pid
socket=0.0.0.0:4563
uid=www
gid=www
master=true
buffer-size = 32768
daemonize = /www/wwwlogs/python/djserverproject/uwsgi.log