/www/server/panel/install/nginx_configure...._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
最后通过面板安装nginx即可,要编译安装!
# nginx -V
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
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; } }
以下配置解决跨域
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 *; }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。