/myproject.sock 连接到上游时失败(111:连接被拒绝),

/myproject.sock 连接到上游时失败(111:连接被拒绝),

我正在通过 nginx 和 uwsgi 提供 flask 服务,但是出现了权限错误

我是 nginx 新手

/var/log/nginx/error.log

 *1 connect() to unix:///usr/share/nginx/html/myproject/myproject.sock failed (111: Connection refused) while connecting to upstream, client: 192.168.100.137, server: 192.168.100.137, request: "GET /myproject/ HTTP/1.1", upstream: "uwsgi://unix:///usr/share/nginx/html/myproject/myproject.sock:", host: "192.168.100.137

/etc/nginx/sites-available/myproject

server {
    listen 80;
    server_name 192.168.100.137;

    location  /myproject {

        include uwsgi_params;
        uwsgi_pass unix:///usr/share/nginx/html/myproject/myproject.sock;
    }
}

/etc/systemd/system/myproject.service

[Unit]
Description=uWSGI instance to serve myproject
After=network.target

[Service]
User=usama
Group=www-data
PrivateTmp=false
PrivateTmp=No
WorkingDirectory=/usr/share/nginx/html
Environment="PATH=/usr/share/nginx/html/myproject/venv/bin"
ExecStart=/usr/share/nginx/html/myproject/venv/bin/uwsgi --ini myproject.ini
[Install]
WantedBy=multi-user.target

/usr/share/nginx/html/myproject/myproject.ini

[uwsgi]
module = wsgi:app

master = true
processes = 5

socket = myproject.sock
chmod-socket = 666
vacuum = true
die-on-term = true

希望找到答案

相关内容