Skip to content

Instantly share code, notes, and snippets.

@avtar
Created October 2, 2013 20:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save avtar/6799918 to your computer and use it in GitHub Desktop.
Save avtar/6799918 to your computer and use it in GitHub Desktop.
Nginx reverse proxy config for CouchDB, taking master-master replication into account
upstream couchdb_servers {
server couchdb1:5984 max_fails=0 fail_timeout=10s;
server couchdb2:5984 max_fails=0 fail_timeout=10s;
}
location / {
proxy_pass http://couchdb_servers:5984;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location ~ ^/(.*)/_changes {
proxy_pass http://couchdb_servers:5984;
proxy_redirect off;
proxy_buffering off;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment