Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save werty1st/8537463 to your computer and use it in GitHub Desktop.
Save werty1st/8537463 to your computer and use it in GitHub Desktop.

Three things to remember while configuring a couchapp to run as a web facing application. Below, I document the steps I took to deploy the example pages app from couchapp.org.

  1. set the vhost in /etc/couchdb/local.ini.

    [vhosts] home.btbytes.com = /pages/_design/pages/_rewrite

  2. add vhosts entry to couchdb by visiting configuration page in futon app and adding a new section:

    section = vhosts option = home.btbytes.com value = /pages/_design/pages/_rewrite

  3. configure nginx to proxy the requests to / to the port running couchdb. See ref

    location / { proxy_pass http://localhost:5984; proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; }

Tests

This returned the page contents as expected.

  • Use curl to replicate data with a couchdb behind nginx + SSL + basic_auth
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment