添加websocket
This commit is contained in:
parent
4af39290ef
commit
58c17c391a
|
|
@ -20,6 +20,26 @@ http {
|
||||||
index index.html index.htm;
|
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/{
|
location /prod-api/{
|
||||||
proxy_set_header Host $http_host;
|
proxy_set_header Host $http_host;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue