crowbait opened a new issue, #5524:
URL: https://github.com/apache/couchdb/issues/5524

   While trying to get couchdb working from behind nginx on a subdirectory 
address (`x.yz/couchdb`), I was following the 
[docs](https://docs.couchdb.org/en/stable/best-practices/reverse-proxies.html#reverse-proxying-couchdb-in-a-subdirectory-with-nginx)
 but couldn't get my setup working with the provided steps.
   
   Using the `nginx.conf` given in the docs, I had 500's because it entered 
redirect loops. Random changes to the config led to 502's as well as every 
subsequent subdirectory not working, but I managed with the following:
   
   ```nginx
   location /couchdb {
       rewrite ^/couchdb/(.*) /$1 break;
       proxy_pass http://localhost:5984/;
       proxy_redirect off;
       proxy_buffering off;
       proxy_set_header Host $host;
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
       proxy_set_header X-Forwarded-Ssl on;
   }
   ```
   
   Changes (compared to the docs) are:
   - removal of first rewrite
   - replacement of proxy_pass URI with `/`
   
   While this (seemingly) works now, I am completely out of my depth when it 
comes to nginx so I don't even really know *why* this works and *why* the 
"official" config didn't (although I'd like to know and learn). Similarly, I 
can't even say with certainty that the docs are wrong. I just know they didn't 
work *for me*.
   
   So I'm just letting you know that this was my experience and I'll leave it 
to much smarter people (aka you) to determine whether the docs are wrong or my 
config is cursed.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to