map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
#配置转发ws请求
location ^~ /jeecg-boot/websocket {
proxy_pass http://192.168.1.65:9090/jeecg-boot/websocket;
add_header Access-Control-Allow-Origin *;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_connect_timeout 4s; #配置点1
proxy_read_timeout 60s; #配置点2,如果没效,可以考虑这个时间配置长一点
proxy_send_timeout 12s; #配置点3
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
```
jeecg配置nginx websocket 转发
最新推荐文章于 2023-10-26 11:06:54 发布