1
votes

I am following the digital ocean tutorial for configuring nginx uwsgi to serve flask application. Digital Ocean Tuttorial link I have made the service for starting my application.But when i run it, i get the following status

Process: 726 ExecStart=/home/user/app/my_project/venv/bin/uwsgi --ini my_project.ini (code=exited, status=217/USER)

myproject.ini contains configuration for running uwsgi

[uwsgi]
module = wsgi

master = true
processes = 5

socket = myproject.sock
chmod-socket = 660
vacuum = true

die-on-term = true

I am able to run app with uswgi on port 8000 but not able to redirect requests from nginx to uwsgi.

Configuration for nginx is:

server {
listen 80;
    server_name my_ip;

    location / {
            include uwsgi_params;
            uwsgi_pass unix:/home/user/app/my_project/myproject.sock;
    }
}
1
Please also post your nginx settings (the server block). - spectras
I see two issues, socket should be full path in both places (uwsgi and nginx config) , right now you have different values here. Or maybe uwsgi has local path, then check your permissions for the user uwsgi process is using, he should have W permission on the file myproject.sock - vittore
I have added nginx to user group by sudo usermod -a -G user nginx and then i made socket writable by chmod 710 /home/user/app/my_project . myproject.ini is inside this folder. - Sugam

1 Answers

0
votes

I figured out that it was a permission issue, socket permission should be 666.