Nginx-gridfs installation

  

mongodb gridfs is suitable for storing video and high-definition pictures and other large files (small files are recommended not to exist in mongodb);

The following is to configure nginx under centos to access mongodb Mp4 file:

1: Install nginx-gridfs

git clone https://github.com/rjhunjhunwla/nginx-gridfs //If git:yum -y install git cd does not exist Nginx-gridfs/git submodule init git submodule update

2::install nginx

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

3: Configure nginx-gridfs: (Reference: https://github.com/rjhunjhunwla/nginx-gridfs related parameter settings)

In the nginx.conf file Join:

location /video { gridfs dbname root_collection=fs field=filename type=string user=username pass=passwd; mongo 127.0.0.1:27017; }

4: html call Display: (http://www.videojs.com/download using video.js)

<video class="video-js vjs- Default-skin" controls width="640" height="264" preload="auto"> <source src="http://127.0.0.1/video/filename.mp4" type='video /mp4' /> </video>

Copyright © Windows knowledge All Rights Reserved