From 9abcaf4c6c5ef293925b30bf6ed2bdc1ab5d117d Mon Sep 17 00:00:00 2001 From: wanggang <76527413@qq.com> Date: Fri, 9 Apr 2021 17:29:17 +0800 Subject: [PATCH] update Former-commit-id: b45377de97a8b31ff23edb75695a5c4e15878ffc Former-commit-id: da1c3d37154683b22e3fcf1b36aed1b43bae7348 --- .../linux-x64/publish/conf/gateway/nginx.conf | 17 +++--- .../publish/conf/platform/nginx.conf | 12 +++-- .../publish/conf/srs/conf/srs.dev.conf | 52 ++++++++++--------- .../linux-x64/publish/conf/website/nginx.conf | 12 +++-- 4 files changed, 52 insertions(+), 41 deletions(-) diff --git a/publish/src/linux-x64/publish/conf/gateway/nginx.conf b/publish/src/linux-x64/publish/conf/gateway/nginx.conf index 4308a260..0d1d28a7 100644 --- a/publish/src/linux-x64/publish/conf/gateway/nginx.conf +++ b/publish/src/linux-x64/publish/conf/gateway/nginx.conf @@ -16,6 +16,11 @@ http { sendfile on; keepalive_timeout 65; + map $http_upgrade $connection_upgrade { + default upgrade; + '' close; + } + server { listen 0.0.0.0:81; server_name localhost; @@ -58,18 +63,12 @@ http { location ^~ /platform/ { proxy_pass http://platform/platform/; - } - - location ^~ /platform/hub { - proxy_pass http://platform/platform/hub; + if ($http_upgrade ~* "close") { + break; + } proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } - - error_page 500 502 503 504 /50x.html; - location = /50x.html { - root html; - } } } \ No newline at end of file diff --git a/publish/src/linux-x64/publish/conf/platform/nginx.conf b/publish/src/linux-x64/publish/conf/platform/nginx.conf index 95c55762..866b4e5e 100644 --- a/publish/src/linux-x64/publish/conf/platform/nginx.conf +++ b/publish/src/linux-x64/publish/conf/platform/nginx.conf @@ -16,16 +16,20 @@ http { sendfile on; keepalive_timeout 65; + map $http_upgrade $connection_upgrade { + default upgrade; + '' close; + } + server { listen 0.0.0.0:80; server_name localhost; location /platform/ { proxy_pass http://host.docker.internal:8011/platform/; - } - - location ^~ /platform/hub { - proxy_pass http://host.docker.internal:8011/platform/hub; + if ($http_upgrade ~* "close") { + break; + } proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; diff --git a/publish/src/linux-x64/publish/conf/srs/conf/srs.dev.conf b/publish/src/linux-x64/publish/conf/srs/conf/srs.dev.conf index e55f73ef..dbda3adf 100644 --- a/publish/src/linux-x64/publish/conf/srs/conf/srs.dev.conf +++ b/publish/src/linux-x64/publish/conf/srs/conf/srs.dev.conf @@ -22,9 +22,9 @@ stats { network 0; disk sda sdb xvda xvdb; } -rtc_server { - enabled on; - listen 8000; +rtc_server{ + enabled on; + listen 8000; candidate *; } vhost __defaultVhost__ { @@ -32,11 +32,12 @@ vhost __defaultVhost__ { enabled on; bframe discard; } - tcp_nodelay on min_latency on; + tcp_nodelay on + min_latency on; play { - gop_cache off; - queue_length 10; - mw_latency 100; + gop_cache off; + queue_length 10; + mw_latency 100; } publish { mr off; @@ -59,23 +60,26 @@ vhost __defaultVhost__ { output ./objs/nginx/html/[app]/[stream].png; } engine ff { - enabled off; - vfilter; - vcodec libx264; - vbitrate 500; - vfps 25; - vwidth 768; - vheight 320; - vthreads 12; - vprofile main; - vpreset medium; - vparams; - acodec libfdk_aac; - abitrate 70; - asample_rate 44100; - achannels 2; - aparams; - output rtmp://127.0.0.1:[port]/[app]?vhost=[vhost]/[stream]_[engine]; + enabled off; + vfilter { + } + vcodec libx264; + vbitrate 500; + vfps 25; + vwidth 768; + vheight 320; + vthreads 12; + vprofile main; + vpreset medium; + vparams { + } + acodec libfdk_aac; + abitrate 70; + asample_rate 44100; + achannels 2; + aparams { + } + output rtmp://127.0.0.1:[port]/[app]?vhost=[vhost]/[stream]_[engine]; } } http_remux { diff --git a/publish/src/linux-x64/publish/conf/website/nginx.conf b/publish/src/linux-x64/publish/conf/website/nginx.conf index dedfc7b0..495fb2ee 100644 --- a/publish/src/linux-x64/publish/conf/website/nginx.conf +++ b/publish/src/linux-x64/publish/conf/website/nginx.conf @@ -16,6 +16,11 @@ http { sendfile on; keepalive_timeout 65; + map $http_upgrade $connection_upgrade { + default upgrade; + '' close; + } + upstream proxy { server gateway:81; } @@ -35,10 +40,9 @@ http { location ~* ^/(platform|dfs|live|video|influxdb|portainer|minio|mysqlui|influxui|phpredisadmin|srs)/ { proxy_pass http://proxy; - } - - location ^~ /platform/hub { - proxy_pass http://proxy; + if ($http_upgrade ~* "close") { + break; + } proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade";