fix(nginx): preserve query string for Socket.IO proxy

Add $is_args$args to proxy_pass for /socket.io/ and /ws/ locations
to fix "Transport unknown" error caused by missing query parameters.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
hailin 2026-01-09 19:19:52 -08:00
parent 92e2b7e445
commit ec66d58e61
2 changed files with 4 additions and 3 deletions

View File

@ -13,7 +13,8 @@
"Bash(git push:*)",
"Bash(docker compose:*)",
"Bash(ssh:*)",
"Bash(ping:*)"
"Bash(ping:*)",
"Bash(curl:*)"
]
}
}

View File

@ -74,7 +74,7 @@ server {
# WebSocket 代理
location /ws/ {
set $ws_upstream conversation-service:3004;
proxy_pass http://$ws_upstream/;
proxy_pass http://$ws_upstream/$is_args$args;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
@ -92,7 +92,7 @@ server {
# Socket.IO 专用路径
location /socket.io/ {
set $ws_upstream conversation-service:3004;
proxy_pass http://$ws_upstream/socket.io/;
proxy_pass http://$ws_upstream/socket.io/$is_args$args;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";