diff --git a/nginx/conf.d/default.conf b/nginx/conf.d/default.conf index 6b0c68c..24ef532 100644 --- a/nginx/conf.d/default.conf +++ b/nginx/conf.d/default.conf @@ -72,10 +72,10 @@ server { proxy_buffers 8 4k; } - # WebSocket 代理 + # WebSocket/Socket.IO 代理 - 保留完整路径 location /ws/ { set $ws_upstream conversation-service:3004; - proxy_pass http://$ws_upstream/$is_args$args; + proxy_pass http://$ws_upstream; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; @@ -90,23 +90,6 @@ server { proxy_read_timeout 7d; } - # Socket.IO 专用路径 - location /socket.io/ { - set $ws_upstream conversation-service:3004; - 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"; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - - proxy_connect_timeout 7d; - proxy_send_timeout 7d; - proxy_read_timeout 7d; - } - # 禁止访问隐藏文件 location ~ /\. { deny all;