大网数据广告活动
服务器运维问答

How to host CouchDB with Fauxton at a non-root location using Nginx as reverse proxy

· 52CE 我爱测

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 /couchd…

问题原文

原帖链接 · 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:

  1. https://github.com/apache/couchdb-fauxton/issues/1199
  2. https://github.com/apache/couchdb-fauxton/issues/944
  3. 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:

  1. It's proxy_pass http://...5984/;. Notice the / at the end.
  2. You should type http://example.com/mycouch/_utils/. Notice the / at the end.
  3. There is a problem with Fauxton itself (Unexpected token < in JSON at position 0 error), follow this recipe to build and install the latest version of Fauxton.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2019-12-07)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。