【发布时间】:2016-05-22 13:03:55
【问题描述】:
我尝试将路径转发到特定的 url,我的 websocket 请求必须去那里。它监听 8180 端口。我从Nico Kaiser 中找到了示例。
我的 nginx 配置现在如下所示:
location /sideview/frontend {
access_log off;
proxy_pass http://domain.de:8180;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# WebSocket support (nginx 1.4)
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
# Path rewriting
rewrite /sideview/frontend/(.*) /$1 break;
proxy_redirect off;
}
当我尝试连接到 URL 时,错误:*2508595 no live upstreams while connecting to upstream, client: 87.79.66.136, server: domain.de, request: "GET /sideview/frontend/ws HTTP/1.1", upstream: "http://domain.de/ws", host: "domain.de"
正如日志告诉我的那样,请求也没有到达 websockets 服务器。
为了让它正确,我必须改变什么?
【问题讨论】: