编译Nginx
wget http://h264.code-shop.com/download/nginx_mod_h264_streaming-2.2.7.tar.gz tar xzvf nginx_mod_h264_streaming-2.2.7.tar.gz # https://github.com/arut/nginx-rtmp-module unzip nginx-rtmp-module-master.zip vi nginx_mod_h264_streaming-2.2.7/src/ngx_http_streaming_module.c # 注释以下内容 /* TODO: Win32 */ if (r->zero_in_uri) { return NGX_DECLINED; } groupadd nginx useradd nginx usermod -G nginx nginx tar zxf nginx-1.8.0.tar.gz cd nginx-1.8.0 ./configure --prefix=/usr/local/nginx \ --add-module=/opt/video/nginx_mod_h264_streaming-2.2.7 \ --with-http_flv_module \ --with-http_ssl_module \ --with-http_mp4_module \ --with-http_gzip_static_module \ --with-http_stub_status_module \ --with-pcre=/opt/video/pcre-8.37 \ --with-zlib=/opt/video/zlib-1.2.8 \ --user=nginx --group=nginx \ --add-module=/opt/video/nginx-rtmp-module-master \ --with-cc-opt=-I/opt/ffmpeg/include \ --with-ld-opt=-L/opt/ffmpeg/lib-R/opt/ffmpeg/lib make make install配置nginx.conf文件
server { listen 80; server_name localhost; #charset koi8-r; #access_log logs/host.access.log main; location / { root /var/www/html; index index.html index.htm; location ~ \.flv$ { flv; } location ~ \.mp4$ { mp4; } } location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|js|css)$ { root /var/www/html; break; }