Skip to content

Commit

Permalink
默认代理17000端口
Browse files Browse the repository at this point in the history
  • Loading branch information
vanjoge committed May 29, 2024
1 parent e82db02 commit 3d7b023
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
13 changes: 13 additions & 0 deletions script/nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,9 @@ http {
upstream wss1005{
server wss1005;
}
upstream wss17000{
server wss17000;
}

server{
listen 4443 ssl;
Expand Down Expand Up @@ -171,6 +174,16 @@ http {
proxy_set_header X-Forwarded-For $remote_addr;
proxy_read_timeout 70s;
}
location /wss17000 {
proxy_pass http://wss17000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-real-ip $remote_addr;
proxy_set_header X-real-port $remote_port;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_read_timeout 70s;
}
location /hls {
types {
application/vnd.apple.mpegurl m3u8;
Expand Down
8 changes: 7 additions & 1 deletion script/run_rtvs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,7 @@ function update_nginx()
val7=`echo "$8"| sed 's:\/:\\\/:g'`
val8=`echo "$9"| sed 's:\/:\\\/:g'`
val9=`echo "${10}"| sed 's:\/:\\\/:g'`
val10=`echo "${11}"| sed 's:\/:\\\/:g'`
echo "正在修改nginx配置文件:$1,on_play:$2,on_play_done:$3"
sed -i "s/on_play .*/on_play $val1/g" $1
sed -i "s/on_play_done .*/on_play_done $val2/g" $1
Expand All @@ -507,6 +508,7 @@ function update_nginx()
sed -i "s/172.29.108.247/$val7/g" $1
sed -i "s/listen 1935;/listen $val8;/g" $1
sed -i "s/listen 8080;/listen $val9;/g" $1
sed -i "s/server wss17000;/server $val10;/g" $1
unset val1
unset val2
unset val3
Expand All @@ -516,6 +518,7 @@ function update_nginx()
unset val7
unset val8
unset val9
unset val10
}
function update_cluster_conf()
{
Expand Down Expand Up @@ -783,11 +786,13 @@ function update_config(){
LocPort="$DOCKER_RTVSWEBHTTP_PORT"
GbSipUrl="127.0.0.1:$DOCKER_GBSIP_HTTP_PORT"
RtmpIP=$LocIP
Wss17000="127.0.0.1:$DOCKER_WEBSOCKET_PORT"
else
LocIP="$DOCKER_NETWORK_IPS.$DOCKER_RTVS_IP"
LocPort="80"
GbSipUrl=$DOCKER_GBSIP_IP
RtmpIP=$DOCKER_NETWORK_IPS.$DOCKER_RTMP_IP
Wss17000="$DOCKER_CVCLUSTER_IP:$DOCKER_WEBSOCKET_PORT"
fi


Expand Down Expand Up @@ -836,7 +841,8 @@ function update_config(){
"$LocIP:$DOCKER_FMP4_PORT" \
"$LocIP:$DOCKER_GOV_PORT" \
"$GbSipUrl" \
$DOCKER_RTMP_PORT $DOCKER_RTMP_STATE_PORT
$DOCKER_RTMP_PORT $DOCKER_RTMP_STATE_PORT \
"$Wss17000"



Expand Down

0 comments on commit 3d7b023

Please sign in to comment.