mirror of
https://github.com/containous/traefik.git
synced 2024-12-25 23:21:40 +03:00
42 lines
1.1 KiB
Cheetah
42 lines
1.1 KiB
Cheetah
{{$frontends := List .Prefix "/frontends/" }}
|
|
{{$backends := List .Prefix "/backends/"}}
|
|
|
|
{{range $backends}}
|
|
{{$backend := .}}
|
|
{{$servers := List $backend "/servers/" }}
|
|
|
|
{{$circuitBreaker := Get "" . "/circuitbreaker/" "expression"}}
|
|
{{with $circuitBreaker}}
|
|
[backends.{{Last $backend}}.circuitBreaker]
|
|
expression = "{{$circuitBreaker}}"
|
|
{{end}}
|
|
|
|
{{$loadBalancer := Get "" . "/loadbalancer/" "method"}}
|
|
{{with $loadBalancer}}
|
|
[backends.{{Last $backend}}.loadBalancer]
|
|
method = "{{$loadBalancer}}"
|
|
{{end}}
|
|
|
|
{{range $servers}}
|
|
[backends.{{Last $backend}}.servers.{{Last .}}]
|
|
url = "{{Get "" . "/url"}}"
|
|
weight = {{Get "" . "/weight"}}
|
|
{{end}}
|
|
{{end}}
|
|
|
|
[frontends]{{range $frontends}}
|
|
{{$frontend := Last .}}
|
|
{{$entryPoints := SplitGet . "/entrypoints"}}
|
|
[frontends."{{$frontend}}"]
|
|
backend = "{{Get "" . "/backend"}}"
|
|
passHostHeader = {{Get "false" . "/passHostHeader"}}
|
|
entryPoints = [{{range $entryPoints}}
|
|
"{{.}}",
|
|
{{end}}]
|
|
{{$routes := List . "/routes/"}}
|
|
{{range $routes}}
|
|
[frontends."{{$frontend}}".routes."{{Last .}}"]
|
|
rule = "{{Get "" . "/rule"}}"
|
|
{{end}}
|
|
{{end}}
|