Skip to content

Instantly share code, notes, and snippets.

@tliff
Last active August 29, 2015 14:06
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 tliff/aa7df56102b1a3996288 to your computer and use it in GitHub Desktop.
Save tliff/aa7df56102b1a3996288 to your computer and use it in GitHub Desktop.
Data:
etcdctl mkdir /vhosts
etcdctl mkdir /vhosts/foo
etcdctl mkdir /vhosts/foo/backends
etcdctl mkdir /vhosts/foo/hostnames
etcdctl set /vhosts/foo/backends/mybackend "192.168.0.1:8001"
etcdctl set /vhosts/foo/backends/myotherbackend "192.168.1.1:8001"
etcdctl set /vhosts/foo/hostnames/example "example.com"
Target:
upstream foo {
server 192.168.0.1:8001;
server 192.168.1.1:8001;
}
server {
hostname example.com;
location / {
proxy_pass http://foo;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment