I wanted to map my custom domain to a design document _rewrite.
// Configuration
vhosts www.myapp.com /myapp/_design/user/_rewrite
// Rewrites
[{
"from": "",
"to": "static/browser/index.html"
}, {
"from": "*",
"to": "*"
}]
The first route works fine. I can access the index.html with www.myapp.com. However, now I can't access www.myapp.com/_utils. It says _all_dbs can't be found in the browser console. All other APIs stop working as well.
I guess this is because that path is now converted to /myapp/_design/user/_utils.
How can I fix this?
_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.
http://1.2.3.4:5984
http://www.myapp.com:5984
or https://www.myapp.com:6984
http://futon.myapp.com
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.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With