使用uwsgi和nginx运行Flask应用 [英] Running Flask app with uwsgi and nginx
问题描述
我正在关注数字海洋教程,该教程用于配置nginx uwsgi以服务烧瓶应用程序.数字海洋之路链接我已经提供了用于启动我的应用程序的服务.但是,当我运行它时,我将获得以下状态
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
过程:726 ExecStart =/home/user/app/my/project/venv/bin/uwsgi --ini my_project.ini(代码=已退出,状态为217/USER)
myproject.ini包含用于运行uwsgi的配置
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
我能够使用uswgi在端口8000上运行应用程序,但无法将请求从nginx重定向到uwsgi.
I am able to run app with uswgi on port 8000 but not able to redirect requests from nginx to uwsgi.
nginx的配置为:
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;
}
}
推荐答案
我发现这是一个权限问题,套接字权限应该是666.
I figured out that it was a permission issue, socket permission should be 666.
这篇关于使用uwsgi和nginx运行Flask应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!