nginxgridfs的安装 -电脑资料

电脑资料 时间:2019-01-01 我要投稿
【meiwen.anslib.com - 电脑资料】

   

    mongodb中gridfs适合存放视频和高清图片等等超大文件(小的文件建议不要存在mongodb中);

    以下是在centos下配置nginx来访问mongodb中的mp4文件:

    1:安装nginx-gridfs

    git clone http://github.com/rjhunjhunwla/nginx-gridfs //如果不存在git:yum -y install git

    cd nginx-gridfs/

    git submodule init

    git submodule update

    2::安装nginx

    ./configure --prefix=/opt/nginx --add-module=/opt/software/nginx-gridfs

    make

    make install

    3:配置nginx-gridfs:(参考:http://github.com/rjhunjhunwla/nginx-gridfs 相关的参数设置)

    在nginx.conf文件中加入:

    location /video {

    gridfs dbname

    root_collection=fs

    field=filename

    type=string

    user=username

    pass=passwd;

    mongo 127.0.0.1:27017;

    }

    4:html中调用显示:(http://www.videojs.com/ 下载使用video.js)

   

   

   

最新文章