2017-12-23 16:45:51 +00:00
|
|
|
[backends]
|
|
|
|
{{range $backend := List .Prefix "/backends/"}}
|
|
|
|
{{$backendName := Last $backend}}
|
|
|
|
|
|
|
|
{{$circuitBreaker := Get "" $backend "/circuitbreaker/expression"}}
|
|
|
|
{{with $circuitBreaker}}
|
|
|
|
[backends."{{$backendName}}".circuitBreaker]
|
2015-09-25 09:44:19 +00:00
|
|
|
expression = "{{$circuitBreaker}}"
|
2017-12-23 16:45:51 +00:00
|
|
|
{{end}}
|
2015-09-25 09:44:19 +00:00
|
|
|
|
2017-12-23 16:45:51 +00:00
|
|
|
{{$loadBalancer := Get "" $backend "/loadbalancer/method"}}
|
|
|
|
{{with $loadBalancer}}
|
|
|
|
[backends."{{$backendName}}".loadBalancer]
|
2015-09-25 09:44:19 +00:00
|
|
|
method = "{{$loadBalancer}}"
|
2017-12-23 16:45:51 +00:00
|
|
|
sticky = {{ getSticky $backend }}
|
2017-10-10 09:10:02 +00:00
|
|
|
{{if hasStickinessLabel $backend}}
|
2017-10-16 15:38:03 +00:00
|
|
|
[backends."{{$backendName}}".loadBalancer.stickiness]
|
2017-12-19 13:08:03 +00:00
|
|
|
cookieName = "{{getStickinessCookieName $backend}}"
|
2017-10-10 09:10:02 +00:00
|
|
|
{{end}}
|
2017-12-23 16:45:51 +00:00
|
|
|
{{end}}
|
2015-09-25 09:44:19 +00:00
|
|
|
|
2017-12-23 16:45:51 +00:00
|
|
|
{{$maxConnAmt := Get "" $backend "/maxconn/amount"}}
|
|
|
|
{{$maxConnExtractorFunc := Get "" $backend "/maxconn/extractorfunc"}}
|
|
|
|
{{with $maxConnAmt}}
|
|
|
|
{{with $maxConnExtractorFunc}}
|
|
|
|
[backends."{{$backendName}}".maxConn]
|
2016-04-13 08:11:36 +00:00
|
|
|
amount = {{$maxConnAmt}}
|
|
|
|
extractorFunc = "{{$maxConnExtractorFunc}}"
|
2017-12-23 16:45:51 +00:00
|
|
|
{{end}}
|
|
|
|
{{end}}
|
|
|
|
|
|
|
|
{{$healthCheck := Get "" $backend "/healthcheck/path"}}
|
|
|
|
{{with $healthCheck}}
|
|
|
|
[backends."{{$backendName}}".healthCheck]
|
|
|
|
path = "{{$healthCheck}}"
|
|
|
|
interval = "{{ Get "30s" $backend "/healthcheck/interval" }}"
|
|
|
|
{{end}}
|
|
|
|
|
|
|
|
{{range $server := ListServers $backend}}
|
|
|
|
[backends."{{$backendName}}".servers."{{Last $server}}"]
|
|
|
|
url = "{{Get "" $server "/url"}}"
|
|
|
|
weight = {{Get "0" $server "/weight"}}
|
|
|
|
{{end}}
|
2016-04-13 08:11:36 +00:00
|
|
|
|
2015-09-21 16:05:56 +00:00
|
|
|
{{end}}
|
|
|
|
|
2017-12-23 16:45:51 +00:00
|
|
|
[frontends]
|
|
|
|
{{range $frontend := List .Prefix "/frontends/" }}
|
|
|
|
{{$frontendName := Last $frontend}}
|
|
|
|
|
|
|
|
[frontends."{{$frontendName}}"]
|
|
|
|
backend = "{{Get "" $frontend "/backend"}}"
|
|
|
|
priority = {{Get "0" $frontend "/priority"}}
|
|
|
|
passHostHeader = {{Get "true" $frontend "/passHostHeader"}}
|
|
|
|
|
|
|
|
{{$entryPoints := SplitGet $frontend "/entrypoints"}}
|
2016-02-01 15:08:58 +00:00
|
|
|
entryPoints = [{{range $entryPoints}}
|
|
|
|
"{{.}}",
|
2017-12-23 16:45:51 +00:00
|
|
|
{{end}}]
|
|
|
|
|
|
|
|
{{range $route := List $frontend "/routes/"}}
|
|
|
|
[frontends."{{$frontendName}}".routes."{{Last $route}}"]
|
|
|
|
rule = "{{Get "" $route "/rule"}}"
|
|
|
|
{{end}}
|
|
|
|
|
2015-09-25 09:44:19 +00:00
|
|
|
{{end}}
|
2017-11-23 10:50:03 +00:00
|
|
|
|
2017-12-23 16:45:51 +00:00
|
|
|
{{range $tlsConfiguration := List .Prefix "/tlsconfiguration/"}}
|
|
|
|
|
2017-11-23 10:50:03 +00:00
|
|
|
[[tlsConfiguration]]
|
2017-12-23 16:45:51 +00:00
|
|
|
|
|
|
|
{{$entryPoints := SplitGet $tlsConfiguration "/entrypoints"}}
|
|
|
|
entryPoints = [{{range $entryPoints}}
|
|
|
|
"{{.}}",
|
2017-11-23 10:50:03 +00:00
|
|
|
{{end}}]
|
|
|
|
|
2017-12-23 16:45:51 +00:00
|
|
|
[tlsConfiguration.certificate]
|
|
|
|
certFile = """{{Get "" $tlsConfiguration "/certificate/certfile"}}"""
|
|
|
|
keyFile = """{{Get "" $tlsConfiguration "/certificate/keyfile"}}"""
|
|
|
|
|
|
|
|
{{end}}
|