【发布时间】:2020-12-26 01:38:00
【问题描述】:
我使用 nginx 作为 django 的反向代理,并使用 as config 进行反应
worker_processes 1;
events {
worker_connections 1024;
}
http{
server{
include mime.types;
default_type application/octet-stream;
keepalive_timeout 240;
sendfile on;
listen 8001;
server_name 127.0.0.1;
location /{
proxy_pass http://localhost:3000;
}
location /backend {
proxy_pass http://127.0.0.1:8000;
}
}
}
它工作正常,但我想转发 websocket 以响应热加载。经过大量谷歌搜索后,我仍然没有解决方案。目前它有来自 chrome 控制台的连接错误
WebSocket connection to 'ws://127.0.0.1:8001/sockjs-node' failed: Error during WebSocket handshake: Unexpected response code: 404
【问题讨论】: