2015-10-01 10:04:25 +00:00
|
|
|
{{$frontends := List .Prefix "/frontends/" }}
|
|
|
|
{{$backends := List .Prefix "/backends/"}}
|
2015-09-21 16:05:56 +00:00
|
|
|
|
2016-04-19 17:23:08 +00:00
|
|
|
[backends]{{range $backends}}
|
2015-09-21 16:05:56 +00:00
|
|
|
{{$backend := .}}
|
2016-06-20 22:58:39 +00:00
|
|
|
{{$servers := ListServers $backend }}
|
2015-09-25 09:44:19 +00:00
|
|
|
|
2016-02-01 15:08:58 +00:00
|
|
|
{{$circuitBreaker := Get "" . "/circuitbreaker/" "expression"}}
|
2015-09-25 09:44:19 +00:00
|
|
|
{{with $circuitBreaker}}
|
2016-04-19 17:23:08 +00:00
|
|
|
[backends."{{Last $backend}}".circuitBreaker]
|
2015-09-25 09:44:19 +00:00
|
|
|
expression = "{{$circuitBreaker}}"
|
|
|
|
{{end}}
|
|
|
|
|
2016-02-01 15:08:58 +00:00
|
|
|
{{$loadBalancer := Get "" . "/loadbalancer/" "method"}}
|
2016-09-28 14:29:19 +00:00
|
|
|
{{$sticky := Get "false" . "/loadbalancer/" "sticky"}}
|
2015-09-25 09:44:19 +00:00
|
|
|
{{with $loadBalancer}}
|
2016-04-19 17:23:08 +00:00
|
|
|
[backends."{{Last $backend}}".loadBalancer]
|
2015-09-25 09:44:19 +00:00
|
|
|
method = "{{$loadBalancer}}"
|
2016-09-28 14:29:19 +00:00
|
|
|
sticky = {{$sticky}}
|
2015-09-25 09:44:19 +00:00
|
|
|
{{end}}
|
|
|
|
|
2016-04-13 08:11:36 +00:00
|
|
|
{{$maxConnAmt := Get "" . "/maxconn/" "amount"}}
|
|
|
|
{{$maxConnExtractorFunc := Get "" . "/maxconn/" "extractorfunc"}}
|
|
|
|
{{with $maxConnAmt}}
|
|
|
|
{{with $maxConnExtractorFunc}}
|
2016-04-19 17:23:08 +00:00
|
|
|
[backends."{{Last $backend}}".maxConn]
|
2016-04-13 08:11:36 +00:00
|
|
|
amount = {{$maxConnAmt}}
|
|
|
|
extractorFunc = "{{$maxConnExtractorFunc}}"
|
|
|
|
{{end}}
|
|
|
|
{{end}}
|
|
|
|
|
2015-09-21 16:05:56 +00:00
|
|
|
{{range $servers}}
|
2016-04-19 17:23:08 +00:00
|
|
|
[backends."{{Last $backend}}".servers."{{Last .}}"]
|
2016-02-01 15:08:58 +00:00
|
|
|
url = "{{Get "" . "/url"}}"
|
|
|
|
weight = {{Get "" . "/weight"}}
|
2015-09-21 16:05:56 +00:00
|
|
|
{{end}}
|
|
|
|
{{end}}
|
|
|
|
|
|
|
|
[frontends]{{range $frontends}}
|
2015-09-25 09:44:19 +00:00
|
|
|
{{$frontend := Last .}}
|
2016-02-01 15:08:58 +00:00
|
|
|
{{$entryPoints := SplitGet . "/entrypoints"}}
|
2016-04-12 07:49:37 +00:00
|
|
|
[frontends."{{$frontend}}"]
|
2016-02-01 15:08:58 +00:00
|
|
|
backend = "{{Get "" . "/backend"}}"
|
2016-05-10 11:43:24 +00:00
|
|
|
passHostHeader = {{Get "true" . "/passHostHeader"}}
|
2016-06-06 20:30:23 +00:00
|
|
|
priority = {{Get "0" . "/priority"}}
|
2016-02-01 15:08:58 +00:00
|
|
|
entryPoints = [{{range $entryPoints}}
|
|
|
|
"{{.}}",
|
|
|
|
{{end}}]
|
2015-10-01 10:04:25 +00:00
|
|
|
{{$routes := List . "/routes/"}}
|
2015-09-25 09:44:19 +00:00
|
|
|
{{range $routes}}
|
2016-04-12 07:49:37 +00:00
|
|
|
[frontends."{{$frontend}}".routes."{{Last .}}"]
|
2016-02-01 15:08:58 +00:00
|
|
|
rule = "{{Get "" . "/rule"}}"
|
2015-09-25 09:44:19 +00:00
|
|
|
{{end}}
|
|
|
|
{{end}}
|