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