我有一个带有2个应用程序的nginx负载平衡器,我想避免WebSocket连接到辅助应用程序。我尝试使用此配置强制从/api/v2/ws
到主要IP的流量,但是它不起作用:
http {
upstream common {
ip_hash;
server 10.102.0.251;
server 10.102.0.144;
}
server {
listen 443 http2;
listen [::]:443 http2;
server_name _;
location /api/v2/ws {
proxy_pass http://10.102.0.251/api/v2/ws;
}
}
}