问题
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:
I figured out that it was a permission issue, socket permission should be 666.
来源:https://stackoverflow.com/questions/33246836/running-flask-app-with-uwsgi-and-nginx