赞
踩
https://blog.csdn.net/qq825478739/category_11423046.html
##websocket 代理
server {
listen 8888;
server_name localhost8888;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forward_For $proxy_add_x_forwarded_for;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
## 这里是代理连接自动断开时间 默认60s
## 该指令设置与代理服务器的读超时时间。它决定了nginx会等待多长时间来获得请求的响应。
proxy_read_timeout 3600s;
# 10299 live
location /10299/live/{
proxy_pass http://192.168.0.101:28081/;
}
location /10299/live/ctrl/{
proxy_pass http://192.168.0.101:25000/;
}
# 10299 playback
location /10299/playback/{
proxy_pass http://192.168.0.101:8081/;
}
location /10299/playback/ctrl/{
proxy_pass http://192.168.0.101:15000/;
}
## 8900 设备状态 使用
location /ws{
proxy_pass http://192.168.0.112:8900/ws;
}
}
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。