Home

Awesome

nginx-mongodb-rest

An nginx module which works as a mongodb readonly rest client.

Dependencies

nginx-mongodb-rest requires the mongo-c-driver which is a submodule of this repository. To checkout the submodule run

$ git submodule init
$ git submodule update

Installation

Installing Nginx modules requires rebuilding Nginx from source:

Configuration

location / {
    mongodb_rest "database_name" "collection_name";
}

#example config
location / {
    mongodb_rest "khalid_dev" "products";
}

The above example configuration exposes the products collection in the khalid_dev database. If the server is running on your localhost the command curl -i http://localhost/12 will give you the following output:

HTTP/1.1 200 OK
Server: nginx/0.8.54
Date: Wed, 23 Feb 2011 23:23:11 GMT
Content-Type: application/json
Transfer-Encoding: chunked
Connection: keep-alive

{"_id" : "12" , "name": "funky widgets"}

Known Issues / TODO / Things You Should Hack On

Authors

Khaja Minhajuddin (minhajuddin@cosmicvent.com), Nagaraju BVS (nagaraju@cosmicvent.com)

Credits

License

nginx-mongodb-rest is licensed under the Apache License, Version 2.0. See LICENSE for more details.