运行 带有 uwsgi 和 nginx 的 Flask 应用程序
Running Flask app with uwsgi and nginx
我正在按照数字海洋教程配置 nginx uwsgi 来为烧瓶应用程序提供服务。
Digital Ocean Tuttorial link
当我 运行 时,我已经提供了启动我的 application.But 的服务,我得到以下状态
进程:726 ExecStart=/home/user/app/my_project/venv/bin/uwsgi --ini my_project.ini (code=exited, status=217/USER)
myproject.ini 包含 运行ning uwsgi
的配置
[uwsgi]
module = wsgi
master = true
processes = 5
socket = myproject.sock
chmod-socket = 660
vacuum = true
die-on-term = true
我可以 运行 在端口 8000 上使用 uswgi 应用程序,但无法将请求从 nginx 重定向到 uwsgi。
nginx 的配置是:
server {
listen 80;
server_name my_ip;
location / {
include uwsgi_params;
uwsgi_pass unix:/home/user/app/my_project/myproject.sock;
}
}
我发现是权限问题,socket权限应该是666
我正在按照数字海洋教程配置 nginx uwsgi 来为烧瓶应用程序提供服务。 Digital Ocean Tuttorial link 当我 运行 时,我已经提供了启动我的 application.But 的服务,我得到以下状态
进程:726 ExecStart=/home/user/app/my_project/venv/bin/uwsgi --ini my_project.ini (code=exited, status=217/USER)
myproject.ini 包含 运行ning uwsgi
的配置[uwsgi]
module = wsgi
master = true
processes = 5
socket = myproject.sock
chmod-socket = 660
vacuum = true
die-on-term = true
我可以 运行 在端口 8000 上使用 uswgi 应用程序,但无法将请求从 nginx 重定向到 uwsgi。
nginx 的配置是:
server {
listen 80;
server_name my_ip;
location / {
include uwsgi_params;
uwsgi_pass unix:/home/user/app/my_project/myproject.sock;
}
}
我发现是权限问题,socket权限应该是666