【发布时间】:2012-07-11 03:46:34
【问题描述】:
我想使用 nginx 在端口 80 上服务 couchdb。我基本上像这样设置 nginx conf 文件:
upstream couchdb {
server 127.0.0.1:5984;
}
server {
listen 0.0.0.0:80;
server_name example.com;
access_log /path/to/log/couchdb.log;
location / {
add_header 'Access-Control-Allow-Origin' '*';
proxy_pass http://couchdb;
proxy_set_header Host $host;
proxy_redirect off;
}
}
除了特殊情况外,配置似乎有效。
当我输入http://example.com/_utils/ 时,我进入了couchdb 实例,但如果我输入http://example.com/_utils(注意缺少尾部斜杠),我什么也得不到,因为我被重定向到http://couchdb/_utils。请注意,http://example.com:5984/_utils/ 和 http://example.com:5984/_utils 都可以正常工作。
我的 WAG 是 nginx 配置的问题,但我不确定是怎么回事。
【问题讨论】: