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; 
		}
}
相关推荐
Bruce_Liuxiaowei2 小时前
MQTT协议在物联网环境中的安全风险与防范指南
运维·网络·物联网·安全·网络安全
-dzk-7 小时前
【3DGS复现】Autodl服务器复现3DGS《简单快速》《一次成功》《新手练习复现必备》
运维·服务器·python·计算机视觉·3d·三维重建·三维
CS Beginner7 小时前
【Linux】 Ubuntu 开发环境极速搭建
linux·运维·ubuntu
致宏Rex8 小时前
Docker 实战教程(7) | 镜像管理和仓库操作
运维·docker·容器
子兮曰10 小时前
WebSocket 连接:实现实时双向通信的前端技术
前端·javascript·websocket
wu~97010 小时前
web服务器有哪些?服务器和web服务器有什么区别
运维·服务器·前端
爱倒腾的老唐10 小时前
13、Linux 基本权限
linux·运维·服务器
罗政10 小时前
CentOS 7.6 系统源码部署 HivisionIDPhotos
linux·运维·centos
薰衣草233312 小时前
linux练习-2
linux·运维·服务器
DrugOne13 小时前
Amber24 安装指南:Ubuntu 22.04 + CUDA 12.4 环境
linux·运维·ubuntu·drugone