我的服务器中的Nginx无法读取/捕获文件套接字。我不确定主要问题是否是nginx。以下是我的Systemd Unit File
,.ini
,nginx.conf
系统单位文件
[Unit]
Description=uWSGI instance to serve newflask
After=network.target
[Service]
User=root
Group=nginx
WorkingDirectory=/root/newflask
Environment="PATH=/root/newflask/env/bin"
ExecStart=/root/newflask/env/bin/uwsgi --ini newflask.ini
[Install]
WantedBy=multi-user.target
newflask.ini
[uwsgi]
module = wsgi
master = true
processes = 5
socket = myproject.sock
chmod-socket = 660
vacuum = true
die-on-term = true
nginx.conf
server {
listen 80;
server_name 68.183.236.113;
location / {
include uwsgi_params;
uwsgi_pass unix:/root/newflask/newflask.sock;
}
}
当我尝试运行此命令时
uwsgi --socket 0.0.0.0:8000 --protocol=http -w wsgi
然后我浏览68.183.236.113:8000
,我得到了想要的东西。但是当我想反向代理时,它失败了。有人吗?
sudo tail -2 /var/log/nginx/error.log:
2018/11/22 16:19:34 [crit] 13135#0: *1 connect() to unix:/root/newflask/newflask.sock failed (2: No such file or directory) while connecting to upstream, client: 115.164.206.79, server: 68.183.236.113, request: "GET /favicon.ico HTTP/1.1", upstream: "uwsgi://unix:/root/newflask/newflask.sock:", host: "68.183.236.113", referrer: "http://68.183.236.113/"