我有一个django应用程序,它在django频道中制作,使用Gunicorn、Nginx和Daphne在AWS上托管。WebSocket在localhost上运行得非常好,但是在部署之后,我得到了
WebSocket连接到“ws://www.searchopal.com/ws/chat/z68qxzn1/”失败:WebSocket握手期间出错:意外响应代码:502
日志如下所示:`
HTTP/1.1", upstream: "http://127.0.0.1:8001/ws/chat/z68qxzn1/", host: "www.searchopal.com"
2020/11/25 10:03:52 [error] 1051#1051: *311 connect() failed (111: Connection refused) while connecting to upstream, client: 103.116.251.158, server: ***********, request: "GET /ws/chat/z68qxzn1/ HTTP/1.1", upstream: "http://127.0.0.1:8001/ws/chat/z68qxzn1/", host: "www.searchopal.com"
2020/11/25 10:04:18 [error] 1051#1051: *313 connect() failed (111: Connection refused) while connecting to upstream, client: 103.116.251.158, server: ***********, request: "GET /ws/chat/z68qxzn1/ HTTP/1.1", upstream: "http://127.0.0.1:8001/ws/chat/z68qxzn1/", host: "www.searchopal.com"
2020/11/25 10:04:18 [error] 1051#1051: *315 connect() failed (111: Connection refused) while connecting to upstream, client: 103.116.251.158, server: ***********, request: "GET /ws/chat/z68qxzn1/ HTTP/1.1", upstream: "http://127.0.0.1:8001/ws/chat/z68qxzn1/", host: "www.searchopal.com"
Settings.py具有以下功能:
CHANNEL_LAYERS = {
'default': {
'BACKEND': 'channels_redis.core.RedisChannelLayer',
'CONFIG': {
'hosts': [('127.0.0.1', 6379)],
},
},
}
我应该在通道层中添加我的AWS实例IP还是我的域?
目前没有回答
相关问题 更多 >
编程相关推荐