windows下搭建基于nginx的rtmp服务器
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
windows下搭建基于nginx的rtmp服务器
Windows机器配置:Windows7旗舰版64位Intel(R) Core(TM)i5-2520 CPU @2.50GHz 2.50 GHz内存: 4GB1. 下载nginx 1.7.11.3 Gryphon下载链接:
http://nginx-win.ecsds.eu/download/nginx 1.7.11.3 Gryphon.zip 下载完成后解压;将解压后的目录名: nginx 1.7.11.3 Gryphon改成: nginx-1.7.11.3-Gryphon2. 下载服务器状态检查程序stat.xslhttps:///arut/nginx-rtmp-module/将nginx-rtmp-module-master.zip解压后复制到目
录:nginx-1.7.11.3-Gryphon下,保证stat.xls的目录
为:nginx-1.7.11.3-Gryphon\nginx-rtmp-module\stat.xsl3. 配置文件conf\nginx-win-rtmp.conf 内容如下:#user nobody;# multiple workers works !worker_processes 2;#error_log
logs/error.log;#error_log logs/error.log notice;#error_log logs/error.log info;#pid logs/nginx.pid;events
{ worker_connections 8192; # max value 32768, nginx recycling connections+registry optimization = # this.value * 20 = max concurrent connections currently tested with one worker # C1000K should be possible depending there is enough ram/cpu power # multi_accept on;}rtmp { server { listen 1935;
chunk_size 4000; application live { live on; } }}http { #include
/nginx/conf/naxsi_core.rules; include mime.types; default_type application/octet-stream; #log_format main '$remote_addr:$remote_port - $remote_user [$time_local] "$request" ' # '$status
$body_bytes_sent "$http_referer" ' #
'"$http_user_agent" "$http_x_forwarded_for"'; #access_log logs/access.log main;# # loadbalancing PHP# upstream myLoadBalancer {# server 127.0.0.1:9001 weight=1 fail_timeout=5;# server 127.0.0.1:9002 weight=1 fail_timeout=5;# server 127.0.0.1:9003 weight=1 fail_timeout=5;# server 127.0.0.1:9004 weight=1 fail_timeout=5;# server 127.0.0.1:9005 weight=1 fail_timeout=5;# server 127.0.0.1:9006 weight=1 fail_timeout=5;# server 127.0.0.1:9007 weight=1 fail_timeout=5;# server 127.0.0.1:9008 weight=1 fail_timeout=5;# server 127.0.0.1:9009 weight=1 fail_timeout=5;# server 127.0.0.1:9010 weight=1 fail_timeout=5;# least_conn;# } sendfile off; #tcp_nopush on;
server_names_hash_bucket_size 128;## Start: Timeouts ##
client_body_timeout 10; client_header_timeout 10; keepalive_timeout 30; send_timeout 10; keepalive_requests 10;## End: Timeouts ## #gzip on; server { listen 80; server_name localhost; location /stat { rtmp_stat all; rtmp_stat_stylesheet stat.xsl; } location
/stat.xsl { root nginx-rtmp-module/; } location /control { rtmp_control all; }
#charset koi8-r; #access_log logs/host.access.log main; ## Caching Static Files, put before first location #location ~* \.(jpg|jpeg|png|gif|ico|css|js)$ { # expires 14d; # add_header Vary Accept-Encoding; #}# For Naxsi remove the single # line for learn mode, or the ## lines for full WAF mode location /
{ #include /nginx/conf/mysite.rules; # see also http block naxsi include line
##SecRulesEnabled; ##DeniedUrl "/RequestDenied"; ##CheckRule "$SQL >= 8" BLOCK;
##CheckRule "$RFI >= 8" BLOCK; ##CheckRule "$TRA VERSAL >= 4" BLOCK; ##CheckRule "$XSS >= 8" BLOCK; root html;
index index.html index.htm; }# For Naxsi remove