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
|
|
|
|
2015-10-01 10:04:25 +00:00
|
|
|
{{$circuitBreaker := Get . "/circuitbreaker/" "expression"}}
|
2015-09-25 09:44:19 +00:00
|
|
|
{{with $circuitBreaker}}
|
|
|
|
[backends.{{Last $backend}}.circuitBreaker]
|
|
|
|
expression = "{{$circuitBreaker}}"
|
|
|
|
{{end}}
|
|
|
|
|
2015-10-01 10:04:25 +00:00
|
|
|
{{$loadBalancer := Get . "/loadbalancer/" "method"}}
|
2015-09-25 09:44:19 +00:00
|
|
|
{{with $loadBalancer}}
|
|
|
|
[backends.{{Last $backend}}.loadBalancer]
|
|
|
|
method = "{{$loadBalancer}}"
|
|
|
|
{{end}}
|
|
|
|
|
2015-09-21 16:05:56 +00:00
|
|
|
{{range $servers}}
|
|
|
|
[backends.{{Last $backend}}.servers.{{Last .}}]
|
|
|
|
url = "{{Get . "/url"}}"
|
|
|
|
weight = {{Get . "/weight"}}
|
|
|
|
{{end}}
|
|
|
|
{{end}}
|
|
|
|
|
|
|
|
[frontends]{{range $frontends}}
|
2015-09-25 09:44:19 +00:00
|
|
|
{{$frontend := Last .}}
|
|
|
|
[frontends.{{$frontend}}]
|
|
|
|
backend = "{{Get . "/backend"}}"
|
2015-12-02 07:56:12 +00:00
|
|
|
passHostHeader = {{Get . "/passHostHeader"}}
|
2015-10-01 10:04:25 +00:00
|
|
|
{{$routes := List . "/routes/"}}
|
2015-09-25 09:44:19 +00:00
|
|
|
{{range $routes}}
|
|
|
|
[frontends.{{$frontend}}.routes.{{Last .}}]
|
|
|
|
rule = "{{Get . "/rule"}}"
|
|
|
|
value = "{{Get . "/value"}}"
|
|
|
|
{{end}}
|
|
|
|
{{end}}
|