When following the advice from the wiki
"http://wiki.apache.org/couchdb/Nginx_As_a_Reverse_Proxy";, visiting
http://server/db/_utils did not append the trailing slash; instead, I
was redirected to /server/_utils. This is a bit broken.

Instead, I configure nginx like so. proxy_redirect makes sure
redirects from CouchDB are rewritten to point to the subdirectory, and
it works perfectly.

Although it seems like it should, 'proxy_redirect on' doesn't do the same thing.

/db {
    rewrite /db/(.*) /$1 break;
    proxy_buffering off;
    proxy_set_header X-Forwarded-For $remote_addr;
    proxy_set_header Host $proxy_host;
    proxy_pass http://localhost:5984;
    proxy_redirect http://localhost:5984 http://$host/db;
}

Reply via email to