2015-10-01 10:04:25 +00:00
|
|
|
{{$frontends := List .Prefix "/frontends/" }}
|
|
|
|
{{$backends := List .Prefix "/backends/"}}
|
2015-09-21 16:05:56 +00:00
|
|
|
|
|
|
|
{{range $backends}}
|
|
|
|
{{$backend := .}}
|
2015-10-01 10:04:25 +00:00
|
|
|
{{$servers := List $backend "/servers/" }}
|
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}}
|
|
|
|
[backends.{{Last $backend}}.circuitBreaker]
|
|
|
|
expression = "{{$circuitBreaker}}"
|
|
|
|
{{end}}
|
|
|
|
|
2016-02-01 15:08:58 +00:00
|
|
|
{{$loadBalancer := Get "" . "/loadbalancer/" "method"}}
|
2015-09-25 09:44:19 +00:00
|
|
|
{{with $loadBalancer}}
|
|
|
|
[backends.{{Last $backend}}.loadBalancer]
|
|
|
|
method = "{{$loadBalancer}}"
|
|
|
|
{{end}}
|
|
|
|
|
2016-04-13 08:11:36 +00:00
|
|
|
{{$maxConnAmt := Get "" . "/maxconn/" "amount"}}
|
|
|
|
{{$maxConnExtractorFunc := Get "" . "/maxconn/" "extractorfunc"}}
|
|
|
|
{{with $maxConnAmt}}
|
|
|
|
{{with $maxConnExtractorFunc}}
|
|
|
|
[backends.{{Last $backend}}.maxConn]
|
|
|
|
amount = {{$maxConnAmt}}
|
|
|
|
extractorFunc = "{{$maxConnExtractorFunc}}"
|
|
|
|
{{end}}
|
|
|
|
{{end}}
|
|
|
|
|
2015-09-21 16:05:56 +00:00
|
|
|
{{range $servers}}
|
|
|
|
[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"}}"
|
|
|
|
passHostHeader = {{Get "false" . "/passHostHeader"}}
|
|
|
|
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}}
|