From a6ee6c3d64846db70266d7b1e8818fc31ec15f69 Mon Sep 17 00:00:00 2001 From: qingyanjiu Date: Tue, 27 Sep 2016 13:54:02 +0800 Subject: [PATCH] Update nginx.conf MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 增加了hls的支持,这样就可以支持移动端html5的网页看直播了,推流地址还是没变 --- nginx.conf | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/nginx.conf b/nginx.conf index 141dcd2..f849bf3 100644 --- a/nginx.conf +++ b/nginx.conf @@ -100,6 +100,15 @@ http { #location ~ /\.ht { # deny all; #} + location /live { + # Serve HLS fragments + types { + application/vnd.apple.mpegurl m3u8; + video/mp2t ts; + } + root /tmp; + add_header Cache-Control no-cache; + } } @@ -148,7 +157,8 @@ rtmp { application live { live on; - + hls on; + hls_path /tmp/hls; drop_idle_publisher 10s; recorder preview { @@ -158,12 +168,10 @@ rtmp { record_interval 3600s; exec_record_done bash -c "/ffmpeg-3.1.3-64bit-static/ffmpeg -i $path -vcodec png -vframes 1 -an -f rawvideo -s 640x360 -ss 00:00:01 -y /usr/local/nginx/html/$basename.png"; - } - + } } + } - - } } # stay in the foreground so Docker has a process to track daemon off;