Make proxy examples better (#1080)

This commit is contained in:
Miek Gieben
2017-09-15 11:30:10 +01:00
committed by GitHub
parent 8e8ce6c3e1
commit 19d7d207d3

View File

@@ -113,55 +113,67 @@ proxy example.org 127.0.0.1:9005
Load-balance all requests between three backends (using random policy): Load-balance all requests between three backends (using random policy):
~~~ ~~~ corefile
proxy . 10.0.0.10:53 10.0.0.11:1053 10.0.0.12 . {
proxy . 10.0.0.10:53 10.0.0.11:1053 10.0.0.12
}
~~~ ~~~
Same as above, but round-robin style: Same as above, but round-robin style:
~~~ ~~~ corefile
proxy . 10.0.0.10:53 10.0.0.11:1053 10.0.0.12 { . {
policy round_robin proxy . 10.0.0.10:53 10.0.0.11:1053 10.0.0.12 {
policy round_robin
}
} }
~~~ ~~~
With health checks and proxy headers to pass hostname, IP, and scheme upstream: With health checks and proxy headers to pass hostname, IP, and scheme upstream:
~~~ ~~~ corefile
proxy . 10.0.0.11:53 10.0.0.11:53 10.0.0.12:53 { . {
policy round_robin proxy . 10.0.0.11:53 10.0.0.11:53 10.0.0.12:53 {
health_check /health:8080 policy round_robin
health_check /health:8080
}
} }
~~~ ~~~
Proxy everything except requests to miek.nl or example.org Proxy everything except requests to miek.nl or example.org
~~~ ~~~
proxy . 10.0.0.10:1234 { . {
except miek.nl example.org proxy . 10.0.0.10:1234 {
except miek.nl example.org
}
} }
~~~ ~~~
Proxy everything except example.org using the host resolv.conf nameservers: Proxy everything except `example.org` using the host's `resolv.conf`'s nameservers:
~~~ ~~~ corefile
proxy . /etc/resolv.conf { . {
except miek.nl example.org proxy . /etc/resolv.conf {
except miek.nl example.org
}
} }
~~~ ~~~
Proxy all requests within example.org to Google's dns.google.com. Proxy all requests within `example.org` to Google's `dns.google.com`.
~~~ ~~~ corefile
proxy example.org 1.2.3.4:53 { . {
protocol https_google proxy example.org 1.2.3.4:53 {
protocol https_google
}
} }
~~~ ~~~
Proxy everything with HTTPS to `dns.google.com`, except `example.org`. Then have another proxy in Proxy everything with HTTPS to `dns.google.com`, except `example.org`. Then have another proxy in
another stanza that uses plain DNS to resolve names under `example.org`. another stanza that uses plain DNS to resolve names under `example.org`.
~~~ ~~~ corefile
. { . {
proxy . 1.2.3.4:53 { proxy . 1.2.3.4:53 {
except example.org except example.org