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 := .}}
|
2017-10-10 09:10:02 +00:00
|
|
|
{{$backendName := Last $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}}
|
2017-10-10 09:10:02 +00:00
|
|
|
[backends."{{$backendName}}".circuitBreaker]
|
2015-09-25 09:44:19 +00:00
|
|
|
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}}
|
2017-10-10 09:10:02 +00:00
|
|
|
[backends."{{$backendName}}".loadBalancer]
|
2015-09-25 09:44:19 +00:00
|
|
|
method = "{{$loadBalancer}}"
|
2017-10-16 15:38:03 +00:00
|
|
|
sticky = {{ getSticky . }}
|
2017-10-10 09:10:02 +00:00
|
|
|
{{if hasStickinessLabel $backend}}
|
2017-10-16 15:38:03 +00:00
|
|
|
[backends."{{$backendName}}".loadBalancer.stickiness]
|
2017-10-10 09:10:02 +00:00
|
|
|
cookieName = {{getStickinessCookieName $backend}}
|
|
|
|
{{end}}
|
2015-09-25 09:44:19 +00:00
|
|
|
{{end}}
|
|
|
|
|
2017-05-21 04:38:07 +00:00
|
|
|
{{$healthCheck := Get "" . "/healthcheck/" "path"}}
|
|
|
|
{{with $healthCheck}}
|
2017-10-10 09:10:02 +00:00
|
|
|
[backends."{{$backendName}}".healthCheck]
|
2017-05-21 04:38:07 +00:00
|
|
|
path = "{{$healthCheck}}"
|
|
|
|
interval = "{{ Get "30s" $backend "/healthcheck/" "interval" }}"
|
|
|
|
{{end}}
|
|
|
|
|
2016-04-13 08:11:36 +00:00
|
|
|
{{$maxConnAmt := Get "" . "/maxconn/" "amount"}}
|
|
|
|
{{$maxConnExtractorFunc := Get "" . "/maxconn/" "extractorfunc"}}
|
|
|
|
{{with $maxConnAmt}}
|
|
|
|
{{with $maxConnExtractorFunc}}
|
2017-10-10 09:10:02 +00:00
|
|
|
[backends."{{$backendName}}".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}}
|
2017-10-10 09:10:02 +00:00
|
|
|
[backends."{{$backendName}}".servers."{{Last .}}"]
|
2016-02-01 15:08:58 +00:00
|
|
|
url = "{{Get "" . "/url"}}"
|
2016-11-23 13:49:55 +00:00
|
|
|
weight = {{Get "0" . "/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}}
|