当我尝试加载页面时,出现502错误的请求错误。我已经在gunicorn,nginx和超级用户上设置了django应用。我在这里查看了其他帖子,他们还没有解决问题。
nginx错误日志包括这样的消息
2020/05/06 15:09:00 [crit] 7361#7361: *4 connect() to unix:/home/USER/APP/APP.sock failed (2: No such file or directory) while connecting to upstream, client: IP, server: _, request: "GET / HTTP/1.1", upstream: "http://unix:/home/USER/APP/APP.sock:/", host: "HOST"
主管配置文件
[program:APP]
command=/home/USER/APP/site/bin/python3.7 /home/USER/APP/site/bin/gunicorn --workers 3 --preload --timeout 120 --bind unix:/home/USER/APP/APP.sock APP.wsgi:application
directory=/home/USER/APP
autostart=true
autorestart=true
stderr_logfile=/var/log/APP.err.log
stdout_logfile=/var/log/APP.out.log
nginx配置文件
server {
listen 80;
server_name _;
location = /favicon.ico { access_log off; log_not_found off; }
location /static/ {
root /home/USER/APP;
}
location / {
include proxy_params;
proxy_pass http://unix:/home/USER/APP/APP.sock;
}
}