2016-04-12 09:49:37 +02:00
[backends]
2017-12-31 23:49:32 +01:00
{{range $ service := .Services}}
2018-01-10 16:20:10 +01:00
{{ $ backendName := getServiceBackendName $ service }}
2016-04-12 09:49:37 +02:00
2018-03-28 02:18:07 +02:00
{{ $ circuitBreaker := getCircuitBreaker $ service . TraefikLabels }}
2018-01-01 03:10:17 +01:00
{{if $ circuitBreaker }}
2018-01-10 16:20:10 +01:00
[backends."backend-{{ $ backendName }}".circuitBreaker]
2018-01-01 03:10:17 +01:00
expression = "{{ $ circuitBreaker . Expression }}"
2016-04-12 09:49:37 +02:00
{{end}}
2018-10-29 18:42:03 +01:00
{{ $ responseForwarding := getResponseForwarding $ service . TraefikLabels }}
{{if $ responseForwarding }}
[backends."backend-{{ $ backendName }}".responseForwarding]
flushInterval = "{{ $ responseForwarding . FlushInterval }}"
{{end}}
2018-03-28 02:18:07 +02:00
{{ $ loadBalancer := getLoadBalancer $ service . TraefikLabels }}
2018-01-01 03:10:17 +01:00
{{if $ loadBalancer }}
2018-01-10 16:20:10 +01:00
[backends."backend-{{ $ backendName }}".loadBalancer]
2018-01-01 03:10:17 +01:00
method = "{{ $ loadBalancer . Method }}"
{{if $ loadBalancer . Stickiness }}
2018-01-10 16:20:10 +01:00
[backends."backend-{{ $ backendName }}".loadBalancer.stickiness]
2018-01-01 03:10:17 +01:00
cookieName = "{{ $ loadBalancer . Stickiness . CookieName }}"
2017-10-10 11:10:02 +02:00
{{end}}
2018-01-01 03:10:17 +01:00
{{end}}
2016-08-24 23:46:47 -04:00
2018-03-28 02:18:07 +02:00
{{ $ maxConn := getMaxConn $ service . TraefikLabels }}
2018-01-01 03:10:17 +01:00
{{if $ maxConn }}
2018-01-10 16:20:10 +01:00
[backends."backend-{{ $ backendName }}".maxConn]
2018-01-01 03:10:17 +01:00
extractorFunc = "{{ $ maxConn . ExtractorFunc }}"
amount = {{ $ maxConn . Amount }}
2016-08-24 23:46:47 -04:00
{{end}}
2018-03-28 02:18:07 +02:00
{{ $ healthCheck := getHealthCheck $ service . TraefikLabels }}
2018-01-01 03:49:06 +01:00
{{if $ healthCheck }}
2018-03-07 22:10:04 +01:00
[backends."backend-{{ $ backendName }}".healthCheck]
2018-05-14 12:08:03 +02:00
scheme = "{{ $ healthCheck . Scheme }}"
2018-01-01 03:49:06 +01:00
path = "{{ $ healthCheck . Path }}"
port = {{ $ healthCheck . Port }}
interval = "{{ $ healthCheck . Interval }}"
2018-09-27 13:16:03 -05:00
timeout = "{{ $ healthCheck . Timeout }}"
2018-04-16 11:40:03 +02:00
hostname = "{{ $ healthCheck . Hostname }}"
{{if $ healthCheck . Headers }}
[backends."backend-{{ $ backendName }}".healthCheck.headers]
{{range $k, $v := $ healthCheck . Headers }}
{{ $k}} = "{{ $v}}"
{{end}}
{{end}}
2018-01-01 03:49:06 +01:00
{{end}}
2018-03-28 02:18:07 +02:00
{{ $ buffering := getBuffering $ service . TraefikLabels }}
2018-01-31 15:32:04 +01:00
{{if $ buffering }}
2018-03-07 22:10:04 +01:00
[backends."backend-{{ $ backendName }}".buffering]
2018-01-31 15:32:04 +01:00
maxRequestBodyBytes = {{ $ buffering . MaxRequestBodyBytes }}
memRequestBodyBytes = {{ $ buffering . MemRequestBodyBytes }}
maxResponseBodyBytes = {{ $ buffering . MaxResponseBodyBytes }}
memResponseBodyBytes = {{ $ buffering . MemResponseBodyBytes }}
retryExpression = "{{ $ buffering . RetryExpression }}"
{{end}}
2017-12-31 23:49:32 +01:00
{{end}}
{{range $ index , $ node := .Nodes}}
2018-03-28 02:18:07 +02:00
{{ $ server := getServer $ node }}
2018-01-02 18:21:38 +01:00
[backends."backend-{{ getNodeBackendName $ node }}".servers."{{ getServerName $ node $ index }}"]
2018-03-28 02:18:07 +02:00
url = "{{ $ server . URL }}"
weight = {{ $ server . Weight }}
2017-12-31 23:49:32 +01:00
2016-02-02 18:03:40 +01:00
{{end}}
2016-04-15 09:56:06 +02:00
[frontends]
2017-12-31 23:49:32 +01:00
{{range $ service := .Services}}
2018-01-01 03:10:17 +01:00
[frontends."frontend-{{ $ service . ServiceName }}"]
2018-01-02 18:21:38 +01:00
backend = "backend-{{ getServiceBackendName $ service }}"
2018-03-28 02:18:07 +02:00
priority = {{ getPriority $ service . TraefikLabels }}
passHostHeader = {{ getPassHostHeader $ service . TraefikLabels }}
passTLSCert = {{ getPassTLSCert $ service . TraefikLabels }}
2017-12-31 23:49:32 +01:00
2018-03-28 02:18:07 +02:00
entryPoints = [{{range getFrontEndEntryPoints $ service . TraefikLabels }}
2016-04-12 09:49:37 +02:00
"{{.}}",
2017-12-31 23:49:32 +01:00
{{end}}]
2018-08-29 11:36:03 +02:00
{{ $ tlsClientCert := getPassTLSClientCert $ service . TraefikLabels }}
{{if $ tlsClientCert }}
[frontends."frontend-{{ $ service . ServiceName }}".passTLSClientCert]
pem = {{ $ tlsClientCert . PEM }}
{{ $ infos := $ tlsClientCert . Infos }}
{{if $ infos }}
[frontends."frontend-{{ $ service . ServiceName }}".passTLSClientCert.infos]
notAfter = {{ $ infos . NotAfter }}
notBefore = {{ $ infos . NotBefore }}
sans = {{ $ infos . Sans }}
{{ $ subject := $ infos . Subject }}
{{if $ subject }}
[frontends."frontend-{{ $ service . ServiceName }}".passTLSClientCert.infos.subject]
country = {{ $ subject . Country }}
province = {{ $ subject . Province }}
locality = {{ $ subject . Locality }}
organization = {{ $ subject . Organization }}
commonName = {{ $ subject . CommonName }}
serialNumber = {{ $ subject . SerialNumber }}
2019-01-08 09:46:04 +01:00
domainComponent = {{ $ subject . DomainComponent }}
{{end}}
{{ $ issuer := $ infos . Subject }}
{{if $ issuer }}
[frontends."frontend-{{ $ service . ServiceName }}".passTLSClientCert.infos.issuer]
country = {{ $ issuer . Country }}
province = {{ $ issuer . Province }}
locality = {{ $ issuer . Locality }}
organization = {{ $ issuer . Organization }}
commonName = {{ $ issuer . CommonName }}
serialNumber = {{ $ issuer . SerialNumber }}
domainComponent = {{ $ issuer . DomainComponent }}
2018-08-29 11:36:03 +02:00
{{end}}
{{end}}
{{end}}
2018-07-06 16:52:04 +02:00
2018-08-29 11:36:03 +02:00
{{ $ auth := getAuth $ service . TraefikLabels }}
2018-07-06 16:52:04 +02:00
{{if $ auth }}
[frontends."frontend-{{ $ service . ServiceName }}".auth]
headerField = "{{ $ auth . HeaderField }}"
{{if $ auth . Forward }}
[frontends."frontend-{{ $ service . ServiceName }}".auth.forward]
address = "{{ $ auth . Forward . Address }}"
trustForwardHeader = {{ $ auth . Forward . TrustForwardHeader }}
2018-10-15 10:54:03 +02:00
{{if $ auth . Forward . AuthResponseHeaders }}
authResponseHeaders = [{{range $ auth . Forward . AuthResponseHeaders }}
"{{.}}",
{{end}}]
{{end}}
2018-07-06 16:52:04 +02:00
{{if $ auth . Forward . TLS }}
[frontends."frontend-{{ $ service . ServiceName }}".auth.forward.tls]
ca = "{{ $ auth . Forward . TLS . CA }}"
caOptional = {{ $ auth . Forward . TLS . CAOptional }}
2018-08-21 17:12:03 +02:00
cert = """{{ $ auth . Forward . TLS . Cert }}"""
key = """{{ $ auth . Forward . TLS . Key }}"""
2018-07-06 16:52:04 +02:00
insecureSkipVerify = {{ $ auth . Forward . TLS . InsecureSkipVerify }}
{{end}}
{{end}}
{{if $ auth . Basic }}
[frontends."frontend-{{ $ service . ServiceName }}".auth.basic]
2018-07-16 13:52:03 +02:00
removeHeader = {{ $ auth . Basic . RemoveHeader }}
2018-07-06 16:52:04 +02:00
{{if $ auth . Basic . Users }}
users = [{{range $ auth . Basic . Users }}
"{{.}}",
{{end}}]
{{end}}
usersFile = "{{ $ auth . Basic . UsersFile }}"
{{end}}
{{if $ auth . Digest }}
[frontends."frontend-{{ $ service . ServiceName }}".auth.digest]
2018-07-16 13:52:03 +02:00
removeHeader = {{ $ auth . Digest . RemoveHeader }}
2018-07-06 16:52:04 +02:00
{{if $ auth . Digest . Users }}
users = [{{range $ auth . Digest . Users }}
"{{.}}",
{{end}}]
{{end}}
usersFile = "{{ $ auth . Digest . UsersFile }}"
{{end}}
{{end}}
2017-12-31 23:49:32 +01:00
2018-03-28 02:18:07 +02:00
{{ $ whitelist := getWhiteList $ service . TraefikLabels }}
2018-03-23 17:40:04 +01:00
{{if $ whitelist }}
[frontends."frontend-{{ $ service . ServiceName }}".whiteList]
sourceRange = [{{range $ whitelist . SourceRange }}
"{{.}}",
{{end}}]
2018-08-24 16:20:03 +02:00
{{if $ whitelist . IPStrategy }}
[frontends."frontend-{{ $ service . ServiceName }}".whiteList.IPStrategy]
depth = {{ $ whitelist . IPStrategy . Depth }}
excludedIPs = [{{range $ whitelist . IPStrategy . ExcludedIPs }}
"{{.}}",
{{end}}]
{{end}}
2018-03-23 17:40:04 +01:00
{{end}}
2018-03-28 02:18:07 +02:00
{{ $ redirect := getRedirect $ service . TraefikLabels }}
2018-01-01 04:03:29 +01:00
{{if $ redirect }}
[frontends."frontend-{{ $ service . ServiceName }}".redirect]
entryPoint = "{{ $ redirect . EntryPoint }}"
regex = "{{ $ redirect . Regex }}"
replacement = "{{ $ redirect . Replacement }}"
2018-01-31 19:10:04 +01:00
permanent = {{ $ redirect . Permanent }}
2018-01-01 04:03:29 +01:00
{{end}}
2018-03-28 02:18:07 +02:00
{{ $ errorPages := getErrorPages $ service . TraefikLabels }}
{{if $ errorPages }}
2018-01-01 04:38:10 +01:00
[frontends."frontend-{{ $ service . ServiceName }}".errors]
2018-03-28 02:18:07 +02:00
{{range $ pageName , $ page := $ errorPages }}
2018-03-07 22:10:04 +01:00
[frontends."frontend-{{ $ service . ServiceName }}".errors."{{ $ pageName }}"]
2018-01-01 04:38:10 +01:00
status = [{{range $ page . Status }}
2018-01-10 16:20:10 +01:00
"{{.}}",
{{end}}]
2018-04-11 13:54:03 +02:00
backend = "backend-{{ $ page . Backend }}"
2018-01-01 04:38:10 +01:00
query = "{{ $ page . Query }}"
{{end}}
{{end}}
2018-03-28 02:18:07 +02:00
{{ $ rateLimit := getRateLimit $ service . TraefikLabels }}
{{if $ rateLimit }}
2018-01-01 04:38:10 +01:00
[frontends."frontend-{{ $ service . ServiceName }}".rateLimit]
extractorFunc = "{{ $ rateLimit . ExtractorFunc }}"
[frontends."frontend-{{ $ service . ServiceName }}".rateLimit.rateSet]
2018-03-28 02:18:07 +02:00
{{ range $ limitName , $ limit := $ rateLimit . RateSet }}
2018-03-07 22:10:04 +01:00
[frontends."frontend-{{ $ service . ServiceName }}".rateLimit.rateSet."{{ $ limitName }}"]
2018-01-01 04:38:10 +01:00
period = "{{ $ limit . Period }}"
average = {{ $ limit . Average }}
burst = {{ $ limit . Burst }}
{{end}}
{{end}}
2018-03-28 02:18:07 +02:00
{{ $ headers := getHeaders $ service . TraefikLabels }}
2018-01-10 16:20:10 +01:00
{{if $ headers }}
2018-01-02 18:32:53 +01:00
[frontends."frontend-{{ $ service . ServiceName }}".headers]
SSLRedirect = {{ $ headers . SSLRedirect }}
SSLTemporaryRedirect = {{ $ headers . SSLTemporaryRedirect }}
SSLHost = "{{ $ headers . SSLHost }}"
2018-05-14 11:44:03 +02:00
SSLForceHost = {{ $ headers . SSLForceHost }}
2018-01-02 18:32:53 +01:00
STSSeconds = {{ $ headers . STSSeconds }}
STSIncludeSubdomains = {{ $ headers . STSIncludeSubdomains }}
STSPreload = {{ $ headers . STSPreload }}
ForceSTSHeader = {{ $ headers . ForceSTSHeader }}
FrameDeny = {{ $ headers . FrameDeny }}
CustomFrameOptionsValue = "{{ $ headers . CustomFrameOptionsValue }}"
ContentTypeNosniff = {{ $ headers . ContentTypeNosniff }}
BrowserXSSFilter = {{ $ headers . BrowserXSSFilter }}
2018-03-02 14:24:03 +01:00
CustomBrowserXSSValue = "{{ $ headers . CustomBrowserXSSValue }}"
2018-01-02 18:32:53 +01:00
ContentSecurityPolicy = "{{ $ headers . ContentSecurityPolicy }}"
PublicKey = "{{ $ headers . PublicKey }}"
ReferrerPolicy = "{{ $ headers . ReferrerPolicy }}"
IsDevelopment = {{ $ headers . IsDevelopment }}
2018-01-10 16:20:10 +01:00
{{if $ headers . AllowedHosts }}
AllowedHosts = [{{range $ headers . AllowedHosts }}
2018-01-02 18:32:53 +01:00
"{{.}}",
{{end}}]
{{end}}
2018-01-10 16:20:10 +01:00
{{if $ headers . HostsProxyHeaders }}
HostsProxyHeaders = [{{range $ headers . HostsProxyHeaders }}
2018-01-02 18:32:53 +01:00
"{{.}}",
{{end}}]
{{end}}
2018-01-10 16:20:10 +01:00
{{if $ headers . CustomRequestHeaders }}
2018-01-02 18:32:53 +01:00
[frontends."frontend-{{ $ service . ServiceName }}".headers.customRequestHeaders]
2018-01-10 16:20:10 +01:00
{{range $k, $v := $ headers . CustomRequestHeaders }}
2018-01-02 18:32:53 +01:00
{{ $k}} = "{{ $v}}"
{{end}}
{{end}}
2018-01-10 16:20:10 +01:00
{{if $ headers . CustomResponseHeaders }}
2018-01-02 18:32:53 +01:00
[frontends."frontend-{{ $ service . ServiceName }}".headers.customResponseHeaders]
2018-01-10 16:20:10 +01:00
{{range $k, $v := $ headers . CustomResponseHeaders }}
2018-01-02 18:32:53 +01:00
{{ $k}} = "{{ $v}}"
{{end}}
{{end}}
2018-01-10 16:20:10 +01:00
{{if $ headers . SSLProxyHeaders }}
2018-01-02 18:32:53 +01:00
[frontends."frontend-{{ $ service . ServiceName }}".headers.SSLProxyHeaders]
{{range $k, $v := $ headers . SSLProxyHeaders }}
{{ $k}} = "{{ $v}}"
{{end}}
{{end}}
{{end}}
2018-01-02 18:21:38 +01:00
[frontends."frontend-{{ $ service . ServiceName }}".routes."route-host-{{ $ service . ServiceName }}"]
2018-01-01 03:10:17 +01:00
rule = "{{ getFrontendRule $ service }}"
2017-12-31 23:49:32 +01:00
2016-02-02 18:03:40 +01:00
{{end}}