{"id":13437475,"url":"https://github.com/mdirolf/nginx-gridfs","last_synced_at":"2025-12-17T18:57:02.085Z","repository":{"id":625680,"uuid":"265935","full_name":"mdirolf/nginx-gridfs","owner":"mdirolf","description":"Nginx module for serving files from MongoDB's GridFS","archived":false,"fork":false,"pushed_at":"2013-12-10T14:35:03.000Z","size":204,"stargazers_count":794,"open_issues_count":54,"forks_count":146,"subscribers_count":39,"default_branch":"master","last_synced_at":"2025-03-19T06:42:00.134Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://www.mongodb.org","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mdirolf.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2009-07-31T18:19:45.000Z","updated_at":"2024-10-31T12:44:02.000Z","dependencies_parsed_at":"2022-07-07T15:41:05.977Z","dependency_job_id":null,"html_url":"https://github.com/mdirolf/nginx-gridfs","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/mdirolf/nginx-gridfs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdirolf%2Fnginx-gridfs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdirolf%2Fnginx-gridfs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdirolf%2Fnginx-gridfs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdirolf%2Fnginx-gridfs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mdirolf","download_url":"https://codeload.github.com/mdirolf/nginx-gridfs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdirolf%2Fnginx-gridfs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27785543,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-17T02:00:08.291Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T03:00:57.476Z","updated_at":"2025-12-17T18:57:02.068Z","avatar_url":"https://github.com/mdirolf.png","language":"C","funding_links":[],"categories":["C","Third Modules","Third Party Modules","Tools"],"sub_categories":["C Modules","Administration"],"readme":"nginx-gridfs\n============\n:Authors:\n    Mike Dirolf \u003cmike@dirolf.com\u003e,\n    Chris Triolo,\n    and everyone listed in the Credits section below\n\nNote from Mike: I'm no longer actively maintaining this project. If you're\ninterested in becoming the new maintainer please shoot me an email.\n\nAbout\n=====\n**nginx-gridfs** is an `Nginx \u003chttp://nginx.net/\u003e`_ module to serve\ncontent directly from `MongoDB \u003chttp://www.mongodb.org/\u003e`_'s `GridFS\n\u003chttp://www.mongodb.org/display/DOCS/GridFS\u003e`_.\n\nVersion\n============\nThe minor version will be incremented with each release until\na stable 1.0 is reached. To check out a particular version::\n\n    $ git checkout v0.8\n\nDependencies\n============\n**nginx-gridfs** requires the Mongo-C-Driver which is a submodule to\nthis repository. To check out the submodule (after cloning this\nrepository), run::\n\n    $ git submodule init\n    $ git submodule update\n\nInstallation\n============\nInstalling Nginx modules requires rebuilding Nginx from source:\n\n* Grab the `Nginx source \u003chttp://nginx.net/\u003e`_ and unpack it.\n* Clone this repository somewhere on your machine.\n* Check out the required submodule, as described above.\n* Change to the directory containing the Nginx source.\n* Now build::\n\n    $ ./configure --add-module=/path/to/nginx-gridfs/source/\n    $ make\n    $ make install\n\nConfiguration\n=============\n\nDirectives\n----------\n\n**gridfs**\n\n:syntax: *gridfs DB_NAME [root_collection=ROOT] [field=QUERY_FIELD] [type=QUERY_TYPE] [user=USERNAME] [pass=PASSWORD]* \n:default: *NONE*\n:context: location\n\nThis directive enables the **nginx-gridfs** module at a given location. The \nonly required parameter is DB_NAME to specify the database to serve files from. \n\n* *root_collection=* specify the root_collection(prefix) of the GridFS. default: *fs*\n* *field=* specify the field to query. Supported fields include *_id* and *filename*. default: *_id*\n* *type=* specify the type to query. Supported types include *objectid*, *string* and *int*. default: *objectid*\n* *user=* specify a username if your mongo database requires authentication. default: *NULL*\n* *pass=* specify a password if your mongo database requires authentication. default: *NULL*\n\n**mongo**\n\nWhen connecting to a single server::\n\n:syntax: *mongo MONGOD_HOST*\n:default: *127.0.0.1:27017*\n:context: location\n\nWhen connecting to a replica set::\n\n:syntax: *mongo REPLICA_SET_NAME* *MONGOD_SEED_1* *MONGOD_SEED_2*\n:default: *127.0.0.1:27017*\n:context: location\n\nThis directive specifies a mongod or replica set to connect to. MONGOD_HOST should be in the\nform of hostname:port. REPLICA_SET_NAME should be the name of the replica set to connect to.\n\nIf this directive is not provided, the module will attempt to connect to a MongoDB server at *127.0.0.1:27017*.\n\nSample Configurations\n---------------------\n\nHere is a sample configuration in the relevant section of an *nginx.conf*::\n\n  location /gridfs/ {\n      gridfs my_app;\n  }\n\nThis will set up Nginx to serve the file in gridfs with _id *ObjectId(\"a12...\")*\nfor any request to */gridfs/a12...*\n\nHere is another configuration::\n\n  location /gridfs/ {\n      gridfs my_app field=filename type=string;\n      mongo 127.0.0.1:27017;\n  }\n\nThis will set up Nginx to serve the file in gridfs with filename *foo*\nfor any request to */gridfs/foo*\n\nHere's how to connect to a replica set called \"foo\" with two seed nodes::\n\n  location /gridfs/ {\n      gridfs my_app field=filename type=string;\n      mongo \"foo\"\n            10.7.2.27:27017\n            10.7.2.28:27017;\n  }\n\nHere is another configuration::\n\n  location /gridfs/ {\n      gridfs my_app \n             root_collection=pics \n             field=_id \n             type=int\n             user=foo \n             pass=bar;\n      mongo 127.0.0.1:27017;\n  } \n\nThis will set up Nginx to communicate with the mongod at 127.0.0.1:27017 and \nauthenticate use of database *my_app* with username/password combo *foo/bar*.\nThe gridfs root_collection is specified as *pics*. Nginx will then serve the \nfile in gridfs with _id *123...* for any request to */gridfs/123...*\n\nKnown Issues / TODO / Things You Should Hack On\n===============================================\n\n* HTTP range support for partial downloads\n* Better error handling / logging\n\nCredits\n=======\n\n* Sho Fukamachi (sho) - towards compatibility with newer boost versions\n* Olivier Bregeras (stunti) - better handling of binary content\n* Chris Heald (cheald) - better handling of binary content\n* Paul Dlug (pdlug) - mongo authentication\n* Todd Zusman (toddzinc) - gzip handling\n* Kyle Banker (banker) - replica set support\n\nLicense\n=======\n**nginx-gridfs** is dual licensed under the Apache License, Version\n2.0 and the GNU General Public License, either version 2 or (at your\noption) any later version. See *LICENSE* for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdirolf%2Fnginx-gridfs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmdirolf%2Fnginx-gridfs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdirolf%2Fnginx-gridfs/lists"}