nginx - uWSGI HTTP + websocket配置 [英] nginx - uWSGI HTTP + websocket config
问题描述
我正在尝试为使用http& websocket查询。
这是我为实现这个目的而设计的uWSGI ini
文件
I'm trying to configure uWSGI for an application (Django) that uses http & websocket queries.
Here is the uWSGI ini
file that I did to achieve this
[uwsgi]
ini = :runserver
ini = :wsserver
[default]
userhome = /home/myuser
virtualenv = %(userhome)/.virtualenvs/myapp
chdir = %(userhome)/Documents/myapp
master = true
no-orphans = true
uid = www-data
gid = www-data
threads = 1
env = DJANGO_SETTINGS_MODULE=myapp.settings
vacuum = true
[runserver]
ini = :default
socket = /tmp/myapp.sock
module = wsgi_django
buffer-size = 32768
processes = 4
[wsserver]
ini = :default
http-socket = /tmp/myapp_websocket.sock
module = wsgi_websocket
processes = 2
http-websockets = true
gevent = 1000
正如你所看到的,我包括我的服务 runserver
& websocket
从 uwsgi
。
我看到nginx和uwsgi之间进行通信,但nginx总是返回我
As you can see I'm including both my services runserver
& websocket
from uwsgi
.
I see nginx and uwsgi communicating between them but nginx always returns me
NetworkError:502 Bad Gateway
NetworkError: 502 Bad Gateway
我看到uwsgi日志没有错误,但如果我评论其中一个,其他的工作。
I see no error in uwsgi log but if I comment one of them, the other works.
有人可以帮我调试吗?
推荐答案
我最终使用两个不同的文件,并在每个
I ended up by using 2 different files and repeating the common settings on each
这篇关于nginx - uWSGI HTTP + websocket配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!