This commit is contained in:
parent
da9b5b4378
commit
9c0cfbc185
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue