问题原文
原帖链接 · W1M0R · CC BY-SA 4.0
CouchDB is bundled with a version of Fauxton that has a critical bug that prevents Fauxton from working if CouchDB is hosted at a non-root location. So if you want to host CouchDB at /couchdb, then the bundled Fauxton at /couchdb/_utils would try to access CouchDB at the root location / instead of the location /couchdb, causing Fauxton functionality to break.
The problem is explained in more detail by the following issues on GitHub:
- https://github.com/apache/couchdb-fauxton/issues/1199
- https://github.com/apache/couchdb-fauxton/issues/944
- https://github.com/apache/couchdb-fauxton/issues/1188
Is it possible to host CouchDB with Fauxton at a non-root location using Nginx as a reverse proxy, and how can it be achieved?
已采纳解答
原帖链接 · ceremcem · CC BY-SA 4.0
I've been using Fauxton behind Nginx at a subfolder location with the following configuration:
location ^~ /mycouch/ {
proxy_pass http://192.168.2.5:5984/;
proxy_redirect off;
proxy_buffering off;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
A few points to take note:
- It's
proxy_pass http://...5984/;. Notice the/at the end. - You should type
http://example.com/mycouch/_utils/. Notice the/at the end. - There is a problem with Fauxton itself (
Unexpected token < in JSON at position 0error), follow this recipe to build and install the latest version of Fauxton.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
