traefik/templates/docker.tmpl
2016-09-14 14:51:31 -04:00

33 lines
1.2 KiB
Cheetah

[backends]{{range .Containers}}
{{if hasCircuitBreakerLabel .}}
[backends.backend-{{getBackend .}}.circuitbreaker]
expression = "{{getCircuitBreakerExpression .}}"
{{end}}
{{if hasLoadBalancerLabel .}}
[backends.backend-{{getBackend .}}.loadbalancer]
method = "{{getLoadBalancerMethod .}}"
{{end}}
{{if hasMaxConnLabels .}}
[backends.backend-{{getBackend .}}.maxconn]
amount = {{getMaxConnAmount . }}
extractorfunc = "{{getMaxConnExtractorFunc . }}"
{{end}}
[backends.backend-{{getBackend .}}.servers.server-{{.Name | replace "/" "" | replace "." "-"}}]
url = "{{getProtocol .}}://{{getIPAddress .}}:{{getPort .}}"
weight = {{getWeight .}}
{{end}}
[frontends]{{range $frontend, $containers := .Frontends}}
[frontends."frontend-{{$frontend}}"]{{$container := index $containers 0}}
backend = "backend-{{getBackend $container}}"
passHostHeader = {{getPassHostHeader $container}}
priority = {{getPriority $container}}
entryPoints = [{{range getEntryPoints $container}}
"{{.}}",
{{end}}]
[frontends."frontend-{{$frontend}}".routes."route-frontend-{{$frontend}}"]
rule = "{{getFrontendRule $container}}"
{{end}}