Changed vhost and rewrite in CouchDB and can't access the internal API

后端 未结 2 1700
天命终不由人
天命终不由人 2021-01-12 11:24

I wanted to map my custom domain to a design document _rewrite.

// Configuration

vhosts     www.myapp.com    /myapp/_design/user/_rewrite

// Rewrites

[{
          


        
2条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-12 11:33

    _utils and other "special" paths do not cooperate with vhosts very well. Last I checked (version 1.0.2 I think), _utils will display the Futon UI however its AJAX calls to _all_dbs and others will fail and it is a total mess.

    I suggest a strict separation between your app and your internal management. Use the vhost for the application, but always avoid vhosts when accessing Futon or other tools.

    There are a few tricks to avoid your vhost.

    • Use the server IP address instead of the domain name: http://1.2.3.4:5984
    • Use a different port if possible: http://www.myapp.com:5984 or https://www.myapp.com:6984
    • Add an alternative DNS entry pointing to the same couch and use that: http://futon.myapp.com
    • Add a dot at the end of your domain. http://www.myapp.com./ — This is very sneaky (or clever). That is a valid DNS name however CouchDB treats it differently from www.myapp.com therefore you will not trigger the vhost.

提交回复
热议问题