From ec66d58e6107de1cd04475f72f44b3e004ebcce1 Mon Sep 17 00:00:00 2001 From: hailin Date: Fri, 9 Jan 2026 19:19:52 -0800 Subject: [PATCH] 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 --- .claude/settings.local.json | 3 ++- nginx/conf.d/default.conf | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.claude/settings.local.json b/.claude/settings.local.json index 547bc34..3e3e8bd 100644 --- a/.claude/settings.local.json +++ b/.claude/settings.local.json @@ -13,7 +13,8 @@ "Bash(git push:*)", "Bash(docker compose:*)", "Bash(ssh:*)", - "Bash(ping:*)" + "Bash(ping:*)", + "Bash(curl:*)" ] } } diff --git a/nginx/conf.d/default.conf b/nginx/conf.d/default.conf index cc976cd..a6f9477 100644 --- a/nginx/conf.d/default.conf +++ b/nginx/conf.d/default.conf @@ -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";