Replication with remote couchdb: use a proxy or not?

322 views
Skip to first unread message

Ying Bian

unread,
Oct 7, 2015, 10:23:35 AM10/7/15
to PouchDB
Hi,

I plan to replicate a local pouchdb db with a remote couchdb db. In order to access the remote couchdb url, I think there are the following 2 options:

1) Don't expose couchdb url to the public (i.e: bind it to a local address), but to visit it through a reverse proxy set on the application server.
2) Expose couchdb url to the public (i.e: bind to the public address) and use the public url directly to do replication. Besides, I also need to enable CORS of couchdb server.

I prefer #2 in all aspects (e.g: easier to setup, more efficient for replication traffic) except for security concern.  I'm interested to hear your comments.

-Ying

Nolan Lawson

unread,
Oct 8, 2015, 11:15:04 AM10/8/15
to PouchDB
Hi Ying,

I find using an Nginx reverse proxy to almost always be the easiest solution. It's very easy to restrict certain paths, restrict only GET/HEAD, disable Futon/Fauxton, etc. https://wiki.apache.org/couchdb/Nginx_As_a_Reverse_Proxy#Reverse_proxy_for_a_subdirectory

CouchDB permissions also work great, but sometimes it helps to sleep at night to know exactly which paths are allowed/disallowed. :)

Cheers,
Nolan
Reply all
Reply to author
Forward
0 new messages