I was trying to put the gridfs/nginx/mongo setup in place but I am getting some strange errors.
I tried with nginx 0.8.53 and 0.8.54 and latest mongo 1.6.5 64bits on latest Ubuntu.
Compiling with gridfs module worked well: https://github.com/mdirolf/nginx-gridfs
server {
listen xx.xx.xx.xx;
server_name media.foo.com;
access_log /home/cloudy/log/nginx/media-access.log;
error_log /home/cloudy/log/nginx/media-error.log;
location /gridfs/ {
gridfs db_name;
mongo 127.0.0.1:27017;
}
}
I get an empty response when I try to fetch a file:
curl -X GET -i 'http://media.foo.com/gridfs/4d4d526cea26b05041000015'
curl: (52) Empty reply from server
My error.log
2011/02/05 15:28:50 [alert] 7112#0: *1 zero size buf in writer t:0 r:0 f:0 0000000000000000 0000000000000000-0000000000000000 0000000000000000 0-0, client: 80.11.52.189, server: media.uk.cloudy.fr, request: "GET /gridfs/4d4d526dea26b05041000016 HTTP/1.1", host: "media.foo.com"
2011/02/05 15:28:52 [alert] 7112#0: *2 zero size buf in writer t:0 r:0 f:0 0000000000000000 0000000000000000-0000000000000000 0000000000000000 0-0, client: 80.11.52.189, server: media.uk.cloudy.fr, request: "GET /gridfs/4d4d526dea26b05041000016 HTTP/1.1", host: "media.foo.com"
Any suggestion is welcome 🙂
I actually hacked the gridFS module to access something else in mongo. My coworker submitted a pull request then, and I think that is the last thing that was done. I found a memory leak in it too if you would like the patch. This module has not been developed since July. It could be that it may not be compatible with new nginx. We are using this heavily so if I find it is not compatible with .8x/Mongo 1.7.5 I will fix it and let you know. I would ask the maintainer on github in the meantime.
Also this is not developed by 10gen, so you may not be able to get help on mongodb-user. It is not a bug with Mongo. Mongo has changed a lot since July so that may be a problem too. The nginx plugin relies on the mongo C driver too which may be out of date. We are using it successfully with nginx/0.7.67 and mongo 1.6.5.
Run your mongo with verbose (-vvv) and tail the mongo log and hit it. See if your request is actually making a mongo query and if there are errors with that