2016-04-12 10:49:37 +03:00
[backends]
2018-01-01 01:49:32 +03:00
{{range $ service := .Services}}
{{ $ sname := $ service . ServiceName }}
2016-04-12 10:49:37 +03:00
2018-01-01 05:10:17 +03:00
{{ $ circuitBreaker := getCircuitBreaker $ service . Attributes }}
{{if $ circuitBreaker }}
[backends."backend-{{ $ sname }}".circuitBreaker]
expression = "{{ $ circuitBreaker . Expression }}"
2016-04-12 10:49:37 +03:00
{{end}}
2018-01-01 05:10:17 +03:00
{{ $ loadBalancer := getLoadBalancer $ service . Attributes }}
{{if $ loadBalancer }}
[backends."backend-{{ $ sname }}".loadBalancer]
method = "{{ $ loadBalancer . Method }}"
sticky = {{ $ loadBalancer . Sticky }}
{{if $ loadBalancer . Stickiness }}
[backends."backend-{{ $ sname }}".loadBalancer.stickiness]
cookieName = "{{ $ loadBalancer . Stickiness . CookieName }}"
2017-10-10 12:10:02 +03:00
{{end}}
2018-01-01 05:10:17 +03:00
{{end}}
2016-08-25 06:46:47 +03:00
2018-01-01 05:10:17 +03:00
{{ $ maxConn := getMaxConn $ service . Attributes }}
{{if $ maxConn }}
[backends."backend-{{ $ sname }}".maxConn]
extractorFunc = "{{ $ maxConn . ExtractorFunc }}"
amount = {{ $ maxConn . Amount }}
2016-08-25 06:46:47 +03:00
{{end}}
2018-01-01 01:49:32 +03:00
{{end}}
{{range $ index , $ node := .Nodes}}
2018-01-01 05:10:17 +03:00
[backends."backend-{{ getBackend $ node }}".servers."{{ getServerName $ node $ index }}"]
url = "{{ getProtocol $ node . Service . Tags }}://{{ getBackendAddress $ node }}:{{ $ node . Service . Port }}"
weight = {{ getWeight $ node . Service . Tags }}
2018-01-01 01:49:32 +03:00
2016-02-02 20:03:40 +03:00
{{end}}
2016-04-15 10:56:06 +03:00
[frontends]
2018-01-01 01:49:32 +03:00
{{range $ service := .Services}}
2018-01-01 05:10:17 +03:00
[frontends."frontend-{{ $ service . ServiceName }}"]
backend = "backend-{{ $ service . ServiceName }}"
priority = {{ getPriority $ service . Attributes }}
passHostHeader = {{ getPassHostHeader $ service . Attributes }}
2018-01-01 01:49:32 +03:00
2018-01-01 05:10:17 +03:00
entryPoints = [{{range getFrontEndEntryPoints $ service . Attributes }}
2016-04-12 10:49:37 +03:00
"{{.}}",
2018-01-01 01:49:32 +03:00
{{end}}]
2018-01-01 05:10:17 +03:00
basicAuth = [{{range getBasicAuth $ service . Attributes }}
2018-01-01 01:49:32 +03:00
"{{.}}",
{{end}}]
[frontends."frontend-{{ $ service . ServiceName }}".routes."route-host-{{ $ service . ServiceName }}"]
2018-01-01 05:10:17 +03:00
rule = "{{ getFrontendRule $ service }}"
2018-01-01 01:49:32 +03:00
2016-02-02 20:03:40 +03:00
{{end}}