/www/server/panel/install/nginx_configure...._nginx-rtmp-module模块安装">
当前位置:   article > 正文

Nginx 安装 nginx-rtmp-module模块_nginx-rtmp-module模块安装

nginx-rtmp-module模块安装
#安装依赖库
yum install libmaxminddb-devel -y
 
#下载第三方扩展源码
git clone https://github.com/arut/nginx-rtmp-module.git
 
echo "--add-module=/nginx-rtmp-module路径" > /www/server/panel/install/nginx_configure.pl
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7

最后通过面板安装nginx即可,要编译安装!

# nginx -V
  • 1
nginx version: nginx/1.16.1
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-39) (GCC) 
built with OpenSSL 1.1.1b  26 Feb 2019
TLS SNI support enabled
configure arguments: --user=www --group=www --prefix=/www/server/nginx --add-module=/www/server/nginx/src/ngx_devel_kit --add-module=/www/server/nginx/src/lua_nginx_module --add-module=/www/server/nginx/src/ngx_cache_purge --add-module=/www/server/nginx/src/nginx-sticky-module --with-openssl=/www/server/nginx/src/openssl --with-pcre=pcre-8.43 --with-http_v2_module --with-stream --with-stream_ssl_module --with-stream_ssl_preread_module --with-http_stub_status_module --with-http_ssl_module --with-http_image_filter_module --with-http_gzip_static_module --with-http_gunzip_module --with-ipv6 --with-http_sub_module --with-http_flv_module --with-http_addition_module --with-http_realip_module --with-http_mp4_module --with-ld-opt=-Wl,-E --with-cc-opt=-Wno-error --with-ld-opt=-ljemalloc --with-http_dav_module --add-module=/www/server/nginx/src/nginx-dav-ext-module --add-module=/root/nginx-rtmp-module
  • 1
  • 2
  • 3
  • 4
  • 5

nginx rtmp配置
放行1935端口

rtmp {
    server {
        listen 1935;
        chunk_size 4096;
        application myapp {     #自定义的名字
            live on;  
       } 
        application live {
            live on;
            record off;
            hls on;
            hls_path /www/wwwroot/存放路径;
            hls_fragment 1s;
            hls_playlist_length 3s; 
        }
}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16

以下配置解决跨域

 location /stat { 
    	rtmp_stat all;  
        rtmp_stat_stylesheet stat.xsl;  
  }  
  
    location /stat.xsl {    
        root /root/nginx-rtmp-module/;  
    }

    location /live {
            types {
                application/vnd.apple.mpegurl m3u8;
                video/mp2t ts;
            }
            root /www/wwwroot/192.168.10.77;
            add_header Cache-Control no-cache;
	    add_header Access-Control-Allow-Origin *;
	}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/很楠不爱3/article/detail/195974
推荐阅读
相关标签
  

闽ICP备14008679号