This commit is contained in:
孙小云 2026-01-30 17:55:11 +08:00
parent da9b5b4378
commit 9c0cfbc185
2 changed files with 20 additions and 19 deletions

View File

@ -20,6 +20,26 @@ http {
index index.html index.htm;
}
# WebSocket 配置 (必须放在 /prod-api/ 之前)
location /prod-api/websocket/ {
proxy_pass http://ruoyi-gateway:8080/websocket/;
# WebSocket 必需的配置
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
# 其他代理头
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# 超时设置WebSocket 长连接)
proxy_connect_timeout 60s;
proxy_send_timeout 600s;
proxy_read_timeout 600s;
}
location /prod-api/{
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;

View File

@ -20,25 +20,6 @@ http {
index index.html index.htm;
}
# WebSocket 配置 (必须放在 /prod-api/ 之前)
location /prod-api/websocket/ {
proxy_pass http://ruoyi-gateway:8080/websocket/;
# WebSocket 必需的配置
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
# 其他代理头
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# 超时设置WebSocket 长连接)
proxy_connect_timeout 60s;
proxy_send_timeout 600s;
proxy_read_timeout 600s;
}
location /prod-api/{
proxy_set_header Host $http_host;