This will walk you through setting up Sync Gateway behind nginx. The nginx conf will be auto generated based on Sync Gateway status.
Launch CoreOS instances on EC2
Recommended values:
- ClusterSize: 3 nodes (default)
- Discovery URL: as it says, you need to grab a new token from https://discovery.etcd.io/new and paste it in the box.
- KeyPair: the name of the AWS keypair you want to use. If you haven’t already, you’ll want to upload your local ssh key into AWS and create a named keypair.
Wait until instances are up

ssh into a CoreOS instance
Go to the AWS console under EC2 instances and find the public ip of one of your newly launched CoreOS instances.

Choose any one of them (it doesn’t matter which), and ssh into it as the core user with the cert provided in the previous step:
1
| |
Spin up Sync Gateway containers
1 2 | |
Verify etcd entries
1 2 3 4 5 | |
Create data volume container
1 2 | |
Launch sync-gateway-nginx-confd.service
1 2 3 | |
Launch nginx service
1 2 | |
Verify
Try a basic http get.
1 2 3 | |
Add ‘-v’ flag to see which Sync Gateway server is servicing the request
1 2 3 4 | |
If you repeat that a few more times, you should see different ip addresses for the handler.
Take a sync gateway out of rotation
1
| |
Now try hitting nginx again, and should not see the Sync Gw that you just shutdown as a handler.
1 2 3 4 | |
Put sync gateway back into rotation
1
| |
Now try hitting nginx again, and should again see the Sync Gw that you just restarted as being a handler.
1 2 3 4 | |
