2017-12-16 19:22:16 +01:00
[backends]
{{range $ serviceName , $ instances := .Services}}
2017-12-16 19:51:39 +01:00
{{if hasCircuitBreakerLabel $ instances }}
[backends.backend-{{ $ serviceName }}.circuitBreaker]
expression = "{{getCircuitBreakerExpression $ instances }}"
{{end}}
2017-12-16 19:38:12 +01:00
{{if hasLoadBalancerLabel $ instances }}
2017-12-16 19:22:16 +01:00
[backends.backend-{{ $ serviceName }}.loadBalancer]
2017-08-25 11:42:03 +02:00
method = "{{ getLoadBalancerMethod $ instances }}"
2017-12-02 19:30:16 +01:00
sticky = {{ getSticky $ instances }}
2017-12-16 19:22:16 +01:00
{{if hasStickinessLabel $ instances }}
[backends.backend-{{ $ serviceName }}.loadBalancer.stickiness]
2017-10-12 17:50:03 +02:00
cookieName = "{{getStickinessCookieName $ instances }}"
2017-10-10 11:10:02 +02:00
{{end}}
2017-12-16 19:38:12 +01:00
{{end}}
2017-01-05 14:24:17 +00:00
2017-12-16 19:57:40 +01:00
{{if hasMaxConnLabels $ instances }}
[backends.backend-{{ $ serviceName }}.maxConn]
amount = {{getMaxConnAmount $ instances }}
extractorFunc = "{{getMaxConnExtractorFunc $ instances }}"
{{end}}
2017-12-16 19:22:16 +01:00
{{ if hasHealthCheckLabels $ instances }}
[backends.backend-{{ $ serviceName }}.healthCheck]
path = "{{getHealthCheckPath $ instances }}"
2017-12-16 19:29:30 +01:00
port = {{getHealthCheckPort $ instances }}
2017-12-16 19:22:16 +01:00
interval = "{{getHealthCheckInterval $ instances }}"
{{end}}
{{range $ index , $ instance := $ instances }}
[backends.backend-{{ $ instance . Name }}.servers.server-{{ $ instance . Name }}{{ $ instance . ID }}]
url = "{{ getProtocol $ instance }}://{{ getHost $ instance }}:{{ getPort $ instance }}"
weight = {{ getWeight $ instance }}
2017-08-25 11:42:03 +02:00
{{end}}
2017-12-16 19:22:16 +01:00
2017-01-05 14:24:17 +00:00
{{end}}
2017-08-25 11:42:03 +02:00
2017-12-16 19:22:16 +01:00
[frontends]
{{range $ serviceName , $ instances := .Services}}
2017-12-20 22:59:57 +01:00
{{range $ instance := filterFrontends $ instances }}
2017-12-16 19:22:16 +01:00
[frontends.frontend-{{ $ serviceName }}]
backend = "backend-{{ $ serviceName }}"
2017-12-20 22:59:57 +01:00
priority = {{ getPriority $ instance }}
passHostHeader = {{ getPassHostHeader $ instance }}
passTLSCert = {{ getPassTLSCert $ instance }}
2017-12-16 19:22:16 +01:00
2017-12-20 22:59:57 +01:00
entryPoints = [{{range getEntryPoints $ instance }}
2017-08-25 11:42:03 +02:00
"{{.}}",
2017-12-16 19:22:16 +01:00
{{end}}]
2017-12-20 22:59:57 +01:00
{{if getWhitelistSourceRange $ instance }}
whitelistSourceRange = [{{range getWhitelistSourceRange $ instance }}
2017-12-16 20:04:11 +01:00
"{{.}}",
{{end}}]
{{end}}
2017-12-20 22:59:57 +01:00
basicAuth = [{{range getBasicAuth $ instance }}
2017-09-07 17:34:03 +02:00
"{{.}}",
2017-12-16 19:22:16 +01:00
{{end}}]
2017-12-20 22:59:57 +01:00
{{if hasRedirect $ instance }}
2017-12-16 20:12:44 +01:00
[frontends."frontend-{{ $ serviceName }}".redirect]
2017-12-20 22:59:57 +01:00
entryPoint = "{{getRedirectEntryPoint $ instance }}"
regex = "{{getRedirectRegex $ instance }}"
replacement = "{{getRedirectReplacement $ instance }}"
{{end}}
{{ if hasErrorPages $ instance }}
[frontends."frontend-{{ $ serviceName }}".errors]
{{ range $ pageName , $ page := getErrorPages $ instance }}
[frontends."frontend-{{ $ serviceName }}".errors.{{ $ pageName }}]
status = [{{range $ page . Status }}
"{{.}}",
{{end}}]
backend = "{{ $ page . Backend }}"
query = "{{ $ page . Query }}"
{{end}}
{{end}}
{{ if hasRateLimits $ instance }}
[frontends."frontend-{{ $ serviceName }}".rateLimit]
extractorFunc = "{{ getRateLimitsExtractorFunc $ instance }}"
[frontends."frontend-{{ $ serviceName }}".rateLimit.rateSet]
{{ range $ limitName , $ rateLimit := getRateLimits $ instance }}
[frontends."frontend-{{ $ serviceName }}".rateLimit.rateSet.{{ $ limitName }}]
period = "{{ $ rateLimit . Period }}"
average = {{ $ rateLimit . Average }}
burst = {{ $ rateLimit . Burst }}
{{end}}
2017-12-16 20:12:44 +01:00
{{end}}
2018-01-02 15:57:04 +01:00
{{if hasHeaders $ instance }}
2017-12-16 20:24:30 +01:00
[frontends."frontend-{{ $ serviceName }}".headers]
2017-12-20 22:59:57 +01:00
{{if hasSSLRedirectHeaders $ instance }}
SSLRedirect = {{getSSLRedirectHeaders $ instance }}
2017-12-16 20:24:30 +01:00
{{end}}
2017-12-20 22:59:57 +01:00
{{if hasSSLTemporaryRedirectHeaders $ instance }}
SSLTemporaryRedirect = {{getSSLTemporaryRedirectHeaders $ instance }}
2017-12-16 20:24:30 +01:00
{{end}}
2017-12-20 22:59:57 +01:00
{{if hasSSLHostHeaders $ instance }}
SSLHost = "{{getSSLHostHeaders $ instance }}"
2017-12-16 20:24:30 +01:00
{{end}}
2017-12-20 22:59:57 +01:00
{{if hasSTSSecondsHeaders $ instance }}
STSSeconds = {{getSTSSecondsHeaders $ instance }}
2017-12-16 20:24:30 +01:00
{{end}}
2017-12-20 22:59:57 +01:00
{{if hasSTSIncludeSubdomainsHeaders $ instance }}
STSIncludeSubdomains = {{getSTSIncludeSubdomainsHeaders $ instance }}
2017-12-16 20:24:30 +01:00
{{end}}
2017-12-20 22:59:57 +01:00
{{if hasSTSPreloadHeaders $ instance }}
STSPreload = {{getSTSPreloadHeaders $ instance }}
2017-12-16 20:24:30 +01:00
{{end}}
2017-12-20 22:59:57 +01:00
{{if hasForceSTSHeaderHeaders $ instance }}
ForceSTSHeader = {{getForceSTSHeaderHeaders $ instance }}
2017-12-16 20:24:30 +01:00
{{end}}
2017-12-20 22:59:57 +01:00
{{if hasFrameDenyHeaders $ instance }}
FrameDeny = {{getFrameDenyHeaders $ instance }}
2017-12-16 20:24:30 +01:00
{{end}}
2017-12-20 22:59:57 +01:00
{{if hasCustomFrameOptionsValueHeaders $ instance }}
CustomFrameOptionsValue = "{{getCustomFrameOptionsValueHeaders $ instance }}"
2017-12-16 20:24:30 +01:00
{{end}}
2017-12-20 22:59:57 +01:00
{{if hasContentTypeNosniffHeaders $ instance }}
ContentTypeNosniff = {{getContentTypeNosniffHeaders $ instance }}
2017-12-16 20:24:30 +01:00
{{end}}
2017-12-20 22:59:57 +01:00
{{if hasBrowserXSSFilterHeaders $ instance }}
BrowserXSSFilter = {{getBrowserXSSFilterHeaders $ instance }}
2017-12-16 20:24:30 +01:00
{{end}}
2017-12-20 22:59:57 +01:00
{{if hasContentSecurityPolicyHeaders $ instance }}
ContentSecurityPolicy = "{{getContentSecurityPolicyHeaders $ instance }}"
2017-12-16 20:24:30 +01:00
{{end}}
2017-12-20 22:59:57 +01:00
{{if hasPublicKeyHeaders $ instance }}
PublicKey = "{{getPublicKeyHeaders $ instance }}"
2017-12-16 20:24:30 +01:00
{{end}}
2017-12-20 22:59:57 +01:00
{{if hasReferrerPolicyHeaders $ instance }}
ReferrerPolicy = "{{getReferrerPolicyHeaders $ instance }}"
2017-12-16 20:24:30 +01:00
{{end}}
2017-12-20 22:59:57 +01:00
{{if hasIsDevelopmentHeaders $ instance }}
IsDevelopment = {{getIsDevelopmentHeaders $ instance }}
2017-12-16 20:24:30 +01:00
{{end}}
2017-12-20 22:59:57 +01:00
{{if hasRequestHeaders $ instance }}
2017-12-16 20:24:30 +01:00
[frontends."frontend-{{ $ serviceName }}".headers.customRequestHeaders]
2017-12-20 22:59:57 +01:00
{{range $k, $v := getRequestHeaders $ instance }}
2017-12-16 20:24:30 +01:00
{{ $k}} = "{{ $v}}"
{{end}}
{{end}}
2017-12-20 22:59:57 +01:00
{{if hasResponseHeaders $ instance }}
2017-12-16 20:24:30 +01:00
[frontends."frontend-{{ $ serviceName }}".headers.customResponseHeaders]
2017-12-20 22:59:57 +01:00
{{range $k, $v := getResponseHeaders $ instance }}
2017-12-16 20:24:30 +01:00
{{ $k}} = "{{ $v}}"
{{end}}
{{end}}
2017-12-20 22:59:57 +01:00
{{if hasAllowedHostsHeaders $ instance }}
2017-12-16 20:24:30 +01:00
[frontends."frontend-{{ $ serviceName }}".headers.AllowedHosts]
2017-12-20 22:59:57 +01:00
{{range getAllowedHostsHeaders $ instance }}
2017-12-16 20:24:30 +01:00
"{{.}}"
{{end}}
{{end}}
2017-12-20 22:59:57 +01:00
{{if hasHostsProxyHeaders $ instance }}
2017-12-16 20:24:30 +01:00
[frontends."frontend-{{ $ serviceName }}".headers.HostsProxyHeaders]
2017-12-20 22:59:57 +01:00
{{range getHostsProxyHeaders $ instance }}
2017-12-16 20:24:30 +01:00
"{{.}}"
{{end}}
{{end}}
2017-12-20 22:59:57 +01:00
{{if hasSSLProxyHeaders $ instance }}
2017-12-16 20:24:30 +01:00
[frontends."frontend-{{ $ serviceName }}".headers.SSLProxyHeaders]
2017-12-20 22:59:57 +01:00
{{range $k, $v := getSSLProxyHeaders $ instance }}
2017-12-16 20:24:30 +01:00
{{ $k}} = "{{ $v}}"
{{end}}
{{end}}
2018-01-02 15:57:04 +01:00
{{end}}
2017-12-16 20:24:30 +01:00
2017-08-25 11:42:03 +02:00
[frontends.frontend-{{ $ serviceName }}.routes.route-frontend-{{ $ serviceName }}]
2017-12-20 22:59:57 +01:00
rule = "{{getFrontendRule $ instance }}"
2017-12-16 19:22:16 +01:00
{{end}}
2017-08-25 11:42:03 +02:00
{{end}}