You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by Daniel Holth <dh...@gmail.com> on 2014/09/05 20:59:24 UTC

Fwd: a better nginx proxy config

Discussing a better nginx config than the one currently in the wiki:
enable proxy_redirect so any CouchDB operations requiring a redirect
work properly, for example _utils -> _utils/ :

 /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;
 }


---------- Forwarded message ----------
From: Andy Wenk <an...@apache.org>
Date: Thu, Sep 4, 2014 at 8:46 AM
Subject: Re: a better nginx proxy config
To: "user@couchdb.apache.org" <us...@couchdb.apache.org>


Hi Daniel,

thanks for the info. Would you please post this in a new thread in dev@
with the question to confirm the behaviour by other users and devs? If
acknowledged, we should update the wiki page (and move it to the new cwiki
:) ).

Thanks a lot!

Cheers

Andy


On 4 September 2014 14:42, Daniel Holth <dh...@gmail.com> wrote:

> 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;
> }
>



--
Andy Wenk
Hamburg - Germany
RockIt!

GPG fingerprint: C044 8322 9E12 1483 4FEC 9452 B65D 6BE3 9ED3 9588

 https://people.apache.org/keys/committer/andywenk.asc