本文主要是介绍jeecg配置nginx websocket 转发,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
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; #配置点1proxy_read_timeout 60s; #配置点2,如果没效,可以考虑这个时间配置长一点proxy_send_timeout 12s; #配置点3proxy_http_version 1.1;proxy_set_header Upgrade $http_upgrade;proxy_set_header Connection "upgrade"; } ```
这篇关于jeecg配置nginx websocket 转发的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!