2017-03-21 7 views
0

nginxサーバーの背後にあるemperorモード(メインアプリ+ websocket用)で2人のvassalsを実行している問題があります。すべて正常に動作しているようですが、すべてのwebsocket要求がエラー502の不良ゲートウェイを返します。 websocketアプリはdjango-websocket-redisです。私が間違っていたアイデア?皇帝モードで複数のuwsgi vassals(ウェブソケット付き)を使用してnginxを設定するにはどうすればよいですか?

/etc/uwsgi/vassals/dashdb_websocket.iniで成り上がり

exec /usr/local/bin/uwsgi --emperor /etc/uwsgi/vassals/ --logto /var/log/uwsgi.log 

からの実行:

# dashdb_websocket.ini file 

[uwsgi] 
umask = 002 
home = /opt/dashdb/venv/dashdb-3.5 
plugin = python35 
chdir = /opt/dashdb 
master = true 
no-orphans = true 
die-on-term = true 
memory-report = true 
env = DJANGO_SETTINGS_MODULE=dashdb.settings.opener 
socket = /var/run/uwsgi/dashdb_ws.sock 
pythonpath = /opt/dashdb 
module = dashdb.wsgi_websocket 
threads = 1 
processes = 1 
http-websockets = true 
gevent = 1000 
# Log file location 
daemonize = /var/log/uwsgi/dashdb_websocket.log 

/etc/uwsgi/vassals/dashdb.iniで:

# dashdb.ini file 

[uwsgi] 

# Django-related settings 
# the base directory (full path) 
chdir   = /opt/%n 
# Django's wsgi file 
module   = dashdb.wsgi 
# the virtualenv (full path) 
home   = /opt/dashdb/venv/%n-3.5 
plugin   = python35 
# settings location 
env    = DJANGO_SETTINGS_MODULE=dashdb.settings.opener 


# Process-related settings 
# master 
master   = true 
# maximum number of worker processes 
processes  = 3 
# the socket (use the full path to be safe) 
socket   = /var/run/uwsgi/%n.sock 
# ... with appropriate permissions - may be needed 
chmod-socket = 666 
# clear environment on exit 
vacuum   = true 
# Log file location 
daemonize  = /var/log/uwsgi/%n.log 

とnginxの設定:

ログに

エラー:

2017/03/20 23:27:51 [error] 3586#3586: *2759 upstream prematurely closed connection while reading response header from upstream, client: 
10.31.32.22, server: MY_DOMAIN...com, request: "GET /ws/builds?subscribe-broadcast&echo HTTP/1.1", upstream: "http://unix:/var/run/uwsgi/dashdb_ws.sock:/ws/builds?subscribe-broadcast&echo", host: "MY_DOMAIN...com" 

答えて

0

は私がのWebSocketで

http-socket = /var/run/uwsgi/dashdb_ws.sock 

代わりの

socket = /var/run/uwsgi/dashdb_ws.sock 

を設定するために必要なuwsgi設定INI

関連する問題