nginx配置mp4文件在线播放

1、安装依赖软件包
# yum -y install perl-devel perl-ExtUtils-Embed

2、 调整nginx配置
以 nginx-1.6.3为例
# wget http://nginx.org/download/nginx-1.6.3.tar.gz && tar -zxvf nginx-1.6.3.tar.gz && cd nginx-1.6.3
# ./configure --prefix=/usr/local/nginx --with-select_module --with-poll_module --with-file-aio --with-http_ssl_module --with-http_realip_module --with-http_gzip_static_module --with-http_secure_link_module --with-http_sub_module --with-http_stub_status_module --with-http_perl_module --with-ld-opt="-Wl,-E" --with-http_mp4_module --with-http_flv_module
# make
# cp objs/nginx /usr/local/nginx/sbin/nginx

站点配置
在站点配置文件的 server段添加下面的配置

server {
……
location ~ \.mp4$ {
root html;
mp4;
}
……
}

3、测试
# /usr/local/nginx/sbin/nginx -s reload

相关新闻

联系我们

全国服务热线

400-033-9553

电子邮件:admin@example.com
工作时间:09:00-17:00 周一至周五

在线客服
关注微信
关注微信
分享本页
返回顶部