traefik/templates/docker.tmpl

40 lines
1.5 KiB
Cheetah
Raw Normal View History

{{$backendServers := .Servers}}
[backends]{{range $backendName, $backend := .Backends}}
{{if hasCircuitBreakerLabel $backend}}
[backends.backend-{{$backendName}}.circuitbreaker]
expression = "{{getCircuitBreakerExpression $backend}}"
2016-08-25 04:22:06 +00:00
{{end}}
{{if hasLoadBalancerLabel $backend}}
[backends.backend-{{$backendName}}.loadbalancer]
method = "{{getLoadBalancerMethod $backend}}"
sticky = {{getSticky $backend}}
2016-08-25 04:22:06 +00:00
{{end}}
{{if hasMaxConnLabels $backend}}
[backends.backend-{{$backendName}}.maxconn]
amount = {{getMaxConnAmount $backend}}
extractorfunc = "{{getMaxConnExtractorFunc $backend}}"
2016-08-25 04:22:06 +00:00
{{end}}
{{$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}}
{{end}}
2015-09-02 19:13:25 +00:00
[frontends]{{range $frontend, $containers := .Frontends}}
[frontends."frontend-{{$frontend}}"]{{$container := index $containers 0}}
2015-09-09 15:41:33 +00:00
backend = "backend-{{getBackend $container}}"
passHostHeader = {{getPassHostHeader $container}}
priority = {{getPriority $container}}
2016-02-01 15:08:58 +00:00
entryPoints = [{{range getEntryPoints $container}}
"{{.}}",
{{end}}]
[frontends."frontend-{{$frontend}}".routes."route-frontend-{{$frontend}}"]
rule = "{{getFrontendRule $container}}"
2015-10-23 16:59:08 +00:00
{{end}}