2016-09-28 16:29:19 +02:00
|
|
|
{{$backendServers := .Servers}}
|
|
|
|
[backends]{{range $backendName, $backend := .Backends}}
|
|
|
|
{{if hasCircuitBreakerLabel $backend}}
|
|
|
|
[backends.backend-{{$backendName}}.circuitbreaker]
|
|
|
|
expression = "{{getCircuitBreakerExpression $backend}}"
|
2016-08-25 00:22:06 -04:00
|
|
|
{{end}}
|
|
|
|
|
2016-09-28 16:29:19 +02:00
|
|
|
{{if hasLoadBalancerLabel $backend}}
|
|
|
|
[backends.backend-{{$backendName}}.loadbalancer]
|
|
|
|
method = "{{getLoadBalancerMethod $backend}}"
|
|
|
|
sticky = {{getSticky $backend}}
|
2016-08-25 00:22:06 -04:00
|
|
|
{{end}}
|
|
|
|
|
2016-09-28 16:29:19 +02:00
|
|
|
{{if hasMaxConnLabels $backend}}
|
|
|
|
[backends.backend-{{$backendName}}.maxconn]
|
|
|
|
amount = {{getMaxConnAmount $backend}}
|
|
|
|
extractorfunc = "{{getMaxConnExtractorFunc $backend}}"
|
2016-08-25 00:22:06 -04:00
|
|
|
{{end}}
|
2016-09-28 16:29:19 +02:00
|
|
|
|
|
|
|
{{$servers := index $backendServers $backendName}}
|
|
|
|
{{range $serverName, $server := $servers}}
|
|
|
|
[backends.backend-{{$backendName}}.servers.server-{{$server.Name | replace "/" "" | replace "." "-"}}]
|
|
|
|
url = "{{getProtocol $server}}://{{getIPAddress $server}}:{{getPort $server}}"
|
|
|
|
weight = {{getWeight $server}}
|
|
|
|
{{end}}
|
|
|
|
|
2016-09-28 13:28:20 +02:00
|
|
|
{{end}}
|
2015-09-02 21:13:25 +02:00
|
|
|
|
2015-10-23 09:49:19 +02:00
|
|
|
[frontends]{{range $frontend, $containers := .Frontends}}
|
|
|
|
[frontends."frontend-{{$frontend}}"]{{$container := index $containers 0}}
|
2015-09-09 17:41:33 +02:00
|
|
|
backend = "backend-{{getBackend $container}}"
|
2015-10-30 11:33:41 +01:00
|
|
|
passHostHeader = {{getPassHostHeader $container}}
|
2016-06-06 22:30:23 +02:00
|
|
|
priority = {{getPriority $container}}
|
2016-02-01 16:08:58 +01:00
|
|
|
entryPoints = [{{range getEntryPoints $container}}
|
|
|
|
"{{.}}",
|
|
|
|
{{end}}]
|
2015-10-23 09:49:19 +02:00
|
|
|
[frontends."frontend-{{$frontend}}".routes."route-frontend-{{$frontend}}"]
|
|
|
|
rule = "{{getFrontendRule $container}}"
|
2015-10-23 18:59:08 +02:00
|
|
|
{{end}}
|