Running Flask app with uwsgi and nginx

故事扮演 提交于 2021-02-08 08:09:22

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!