我正在使用Nginx和Gunicorn配置Django项目。
此nginx错误日志
2020/11/06 15:09:33 [crit] 13566#13566:* 1 connect()到Unix:/root/projectdir/automation/nacm.sock在连接到上游时失败(13:权限被拒绝),客户端:1xx.1xx.xx.xx,服务器:xxx.xxx.xxx.xx,请求:“ GET / HTTP / 1.1”,上游:“ http:// unix:/root/projectdir/automation/nacm.sock: /”,主机:“ xxx.xxx.xxx.xx”
这是我的gunicorn.service
[Unit]
Description=gunicorn daemon
After=network.target
[Service]
User=root
Group=www-data
WorkingDirectory=/root/otomasiJaringan/automation
ExecStart=/root/otomasiJaringan/env/bin/gunicorn --access-logfile --workers 3 --bind unix:/root/projectdir/automation/nacm.sock nacm.wsgi:application
[Install]
WantedBy=multi-user.target
此网站可用/独角兽
server {
listen 80;
server_name xxx.xxx.xxx.xx;
location = /favicon.ico { access_log off; log_not_found off; }
location /static/ {
root /root/projectdir/automation/website;
}
location / {
include proxy_params;
proxy_pass http://unix:/root/projectdir/automation/nacm.sock;
}
在HTML页面中,我得到502 Bad Gateway。
我在做什么错?