我试图将 gridfs/nginx/mongo 设置到位,但我遇到了一些奇怪的错误。
我在最新的 Ubuntu 上尝试了 nginx 0.8.53 和 0.8.54 以及最新的 mongo 1.6.5 64 位。使用 gridfs 模块编译效果很好: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;
}
}
当我尝试获取文件时,我得到一个空响应:
curl -X GET -i 'http://media.foo.com/gridfs/4d4d526cea26b05041000015'
curl: (52) Empty reply from server
我的错误日志
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"
欢迎任何建议:)