Skip to content

Instantly share code, notes, and snippets.

@nod
Created October 23, 2014 04:33
Show Gist options
  • Save nod/0e12567203e94e3646c1 to your computer and use it in GitHub Desktop.
Save nod/0e12567203e94e3646c1 to your computer and use it in GitHub Desktop.
sample location stanzas for nginx to proxy back to couchbase syncgateway
location /syncgw {
proxy_pass http://127.0.0.1:4984/syncgw;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass_header Server;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_pass_header Accept;
}
location /admin_syncgw {
allow 127.0.0.1;
allow a.b.c.z; # ext interface of this particular server
rewrite ^/admin_syncgw(.*)$ /syncgw$1 break;
proxy_pass http://127.0.0.1:4985/syncgw;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass_header Server;
proxy_pass_header Cookie;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment