我嘗試將路徑轉發到特定的url,我的websocket請求必須去。它聽取端口8180.我發現Nico Kaiser的例子。Nginx Websocket反向代理拋出錯誤
我的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的服務器,如日誌告訴我。
我必須改變什麼才能正確地做出改變?