VPS侦探论坛

 找回密码
 注册
查看: 5045|回复: 3

lnmpa如何支持mp4视频播放?

[复制链接]
发表于 2015-7-12 16:05:42 | 显示全部楼层 |阅读模式

如题, 网站需要支持 mp4播放,可是配置了 nginx后mp4也是无法播放 是不是还需要配置apache?  或者应该咋配置 ,请大神帮助,万分感谢!
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2015-7-13 10:50:48 | 显示全部楼层


编译上mp4模块了吗,nginx配置文件里加上mp4模块的配置了没
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2015-7-13 13:43:37 | 显示全部楼层

[root@VM_45_67_centos ~]# nginx -V
nginx version: nginx/1.6.0
built by gcc 4.4.7 20120313 (Red Hat 4.4.7-11) (GCC)
TLS SNI support enabled
configure arguments: --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module --with-http_mp4_module --with-http_flv_module

我已经加上了 mp4模块  

server
        {
                listen 80 default;
                #listen [::]:80 default ipv6only=on;
                server_name www.lnmp.org;
                index index.html index.htm index.php;
                root  /mnt/wwwroot;

                location / {
                        try_files $uri @apache;

                        location ~ \.flv$
                       {
                         flv;
                       }
                       location ~ \.mp4$
                      {
                          mp4;
                          mp4_buffer_size       1m;
                          mp4_max_buffer_size   5m;
                       }
                        }

这里也加上了,但代码<object declare id="pa_st_5000.3gp" data="http:自己制定网页的mp4" type="video/3gpp">
</object>

这种形式的就不行。
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2015-7-13 21:40:56 | 显示全部楼层



不清楚你这种调用方式是否正确,再就是你调用代码里面的文件后缀不在你设置的配置里

mp4的location应该放到第一个上
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-9-28 01:20 , Processed in 0.031762 second(s), 17 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表