Home Archive RSS Login

I learned something new today

MongoDB - Nginx module for serving files from MongoDB's GridFS

Nginx is a fast web server that is especially popular for its low footprint even under heavy loads. I have tested this on few server setups and found this to be a true statement. 

As mentioned on an earlier post, you can store files in MongoDB using GridFS. This module adds the functionality in Nginx to serve files directly from MongoDB's GridFS as if it were being served from a regular directory. You can get all the information and the files from the following git location:
http://github.com/mdirolf/nginx-gridfs

This is the configuration I tried:
location /gridfs/
    gridfs my_db
           field=filename
           type=string
           user=foo
           pass=bar;
    mongo 127.0.0.1:27017;
}

When a user visits my site and goes to http://mysite/gridfs/image1.jpg, nginx takes this file from my mongodb database my_db and serves it. 


Author: Prit -  Date: 27 Jul 2010 11:22
Tags: mongodb -  Visits: 57078 -  No Comments




Comments

No comments posted yet!


Add Comment

Comment Form

 (Required)

 (Optional, will not be published)

 (Optional, format: http(s)://website.com)



 (kyqp8yd6)