This repository was archived by the owner on Dec 2, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 517
This repository was archived by the owner on Dec 2, 2023. It is now read-only.
使用nginx代理5551端口流量,默认一分钟关闭连接,是否有心跳 api? #611
Copy link
Copy link
Open
Description
1、/rtc.RTC/ 这个ws接口是否有心跳接口?
2、/room.RoomSignal/ 这个ws是否有心跳接口?
demo 使用的是 examples\ion-pubsub
nginx.config
location ^~ /room.RoomSignal/ {
#这里需要说明一下,由于docker的网络问题,我们填127.0.0.1是不可行的
#因为127.0.0.1是docker容器内的网络,不是我们宿主机的网络,所以就不能指向正确的路径
#我们需要填内网的ip地址例如:192.168.1.222,这样才是可以行的
proxy_redirect off;
proxy_pass http://172.25.158.83:5551/room.RoomSignal/; # 转发
proxy_set_header Host $host;
proxy_set_header X-Real_IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr:$remote_port;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade; # 升级协议头
proxy_set_header Connection upgrade;
}
#截取url开头匹配/rtc.RTC/,然后转发到http://172.25.158.83:5551/rtc.RTC/
location ^~ /rtc.RTC/ {
#这里需要说明一下,由于docker的网络问题,我们填127.0.0.1是不可行的
#因为127.0.0.1是docker容器内的网络,不是我们宿主机的网络,所以就不能指向正确的路径
#我们需要填内网的ip地址例如:192.168.1.222,这样才是可以行的
proxy_redirect off;
proxy_pass http://172.25.158.83:5551/rtc.RTC/; # 转发
proxy_set_header Host $host;
proxy_set_header X-Real_IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr:$remote_port;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade; # 升级协议头
proxy_set_header Connection upgrade;
}
location /ion-pubsub/ {
#这里需要说明一下,由于docker的网络问题,我们填127.0.0.1是不可行的
#因为127.0.0.1是docker容器内的网络,不是我们宿主机的网络,所以就不能指向正确的路径
#我们需要填内网的ip地址例如:192.168.1.222,这样才是可以行的
# proxy_pass http://172.16.99.219:8080;
# proxy_set_header Host $host;
# proxy_set_header X-Real-IP $remote_addr;
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade; # 升级协议头
proxy_set_header Connection upgrade;
#项目添加到容器,这是容器的路径
root /usr/local/docker/ion/ion/examples/;
index index.html;
}
Metadata
Metadata
Assignees
Labels
No labels