nginx反向代理websocket 60秒自动断开处理

参考:

https://blog.csdn.net/zqh123zqh/article/details/112795608

添加:

c 复制代码
proxy_read_timeout 600s; 

例如:

c 复制代码
server {
		listen 80;
		server_name carrefourzone.senguo.cc;
		#error_page 502 /static/502.html;
 
		location /static/ {
		    root /home/chenming/Carrefour/carrefour.senguo.cc/source;
		    expires 7d;
        	}
 
		location / {
		    proxy_pass_header Server;
		    proxy_set_header Host $http_host;
		    proxy_redirect off;
		    proxy_set_header X-Real-IP $remote_addr;
		    proxy_set_header X-Scheme $scheme;
		    proxy_pass       http://127.0.0.1:9887;
		    proxy_http_version  1.1;
		    proxy_set_header    Upgrade    "websocket";
		    proxy_set_header    Connection "Upgrade";
		    proxy_read_timeout 600s; 
		}
}
相关推荐
钱栈up33 分钟前
现场部署6个服务菜单全挂:根因不在后端,在前端那个环境变量
mysql·nginx
饿了吃洗衣凝珠7 小时前
shell
linux·运维·服务器
Csvn8 小时前
Nginx 故障案例库:16 张卡的现象、证据、根因与防复发
后端·nginx
Decay__8 小时前
PostgreSQL 性能调优方法论 —— pg_stat_statements、EXPLAIN ANALYZE、瓶颈定位流程与参数基线
运维·数据库·sql·postgresql
stormsha14 小时前
中文路径让 MySQL 起不来:Failed to find valid data directory 与 Illegal byte sequence
运维·数据库·mysql
stormsha14 小时前
MySQL 报 `data directory has files in it`:初始化失败一次,之后就永久起不来
运维·数据库·mysql
YIAN16 小时前
流式 TTS 和普通TTS到底有什么区别?一个文档教会你!
前端·websocket·node.js
沙老师19 小时前
Linux Purification Plan - More Modification
linux·运维·服务器
Decay__20 小时前
PostgreSQL 高可用与容灾架构 —— 流复制、Patroni、Keepalived+VIP、读写分离与两地三中心
运维·数据库·sql·postgresql
梅雅达编程笔记20 小时前
开发机能跑,服务器上跑不起来:MYD 考试系统配置设计与上线清单
mysql·nginx·flask·gunicorn·毕设项目·部署上线