2017-12-16 18:22:16 +00:00
|
|
|
[backends]
|
|
|
|
{{range $serviceName, $instances := .Services}}
|
|
|
|
|
2017-12-16 18:51:39 +00:00
|
|
|
{{if hasCircuitBreakerLabel $instances}}
|
|
|
|
[backends.backend-{{ $serviceName }}.circuitBreaker]
|
|
|
|
expression = "{{getCircuitBreakerExpression $instances}}"
|
|
|
|
{{end}}
|
|
|
|
|
2017-12-16 18:38:12 +00:00
|
|
|
{{if hasLoadBalancerLabel $instances}}
|
2017-12-16 18:22:16 +00:00
|
|
|
[backends.backend-{{ $serviceName }}.loadBalancer]
|
2017-08-25 09:42:03 +00:00
|
|
|
method = "{{ getLoadBalancerMethod $instances}}"
|
2017-12-02 18:30:16 +00:00
|
|
|
sticky = {{ getSticky $instances}}
|
2017-12-16 18:22:16 +00:00
|
|
|
{{if hasStickinessLabel $instances}}
|
|
|
|
[backends.backend-{{ $serviceName }}.loadBalancer.stickiness]
|
2017-10-12 15:50:03 +00:00
|
|
|
cookieName = "{{getStickinessCookieName $instances}}"
|
2017-10-10 09:10:02 +00:00
|
|
|
{{end}}
|
2017-12-16 18:38:12 +00:00
|
|
|
{{end}}
|
2017-01-05 14:24:17 +00:00
|
|
|
|
2017-12-16 18:57:40 +00:00
|
|
|
{{if hasMaxConnLabels $instances}}
|
|
|
|
[backends.backend-{{ $serviceName }}.maxConn]
|
|
|
|
amount = {{getMaxConnAmount $instances}}
|
|
|
|
extractorFunc = "{{getMaxConnExtractorFunc $instances}}"
|
|
|
|
{{end}}
|
|
|
|
|
2017-12-16 18:22:16 +00:00
|
|
|
{{ if hasHealthCheckLabels $instances }}
|
|
|
|
[backends.backend-{{ $serviceName }}.healthCheck]
|
|
|
|
path = "{{getHealthCheckPath $instances }}"
|
2017-12-16 18:29:30 +00:00
|
|
|
port = {{getHealthCheckPort $instances}}
|
2017-12-16 18:22:16 +00: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 09:42:03 +00:00
|
|
|
{{end}}
|
2017-12-16 18:22:16 +00:00
|
|
|
|
2017-01-05 14:24:17 +00:00
|
|
|
{{end}}
|
2017-08-25 09:42:03 +00:00
|
|
|
|
2017-12-16 18:22:16 +00:00
|
|
|
[frontends]
|
|
|
|
{{range $serviceName, $instances := .Services}}
|
2017-12-20 21:59:57 +00:00
|
|
|
{{range $instance := filterFrontends $instances}}
|
2017-12-16 18:22:16 +00:00
|
|
|
|
|
|
|
[frontends.frontend-{{ $serviceName }}]
|
|
|
|
backend = "backend-{{ $serviceName }}"
|
2017-12-20 21:59:57 +00:00
|
|
|
priority = {{ getPriority $instance}}
|
|
|
|
passHostHeader = {{ getPassHostHeader $instance}}
|
|
|
|
passTLSCert = {{ getPassTLSCert $instance}}
|
2017-12-16 18:22:16 +00:00
|
|
|
|
2017-12-20 21:59:57 +00:00
|
|
|
entryPoints = [{{range getEntryPoints $instance}}
|
2017-08-25 09:42:03 +00:00
|
|
|
"{{.}}",
|
2017-12-16 18:22:16 +00:00
|
|
|
{{end}}]
|
|
|
|
|
2017-12-20 21:59:57 +00:00
|
|
|
{{if getWhitelistSourceRange $instance}}
|
|
|
|
whitelistSourceRange = [{{range getWhitelistSourceRange $instance}}
|
2017-12-16 19:04:11 +00:00
|
|
|
"{{.}}",
|
|
|
|
{{end}}]
|
|
|
|
{{end}}
|
|
|
|
|
2017-12-20 21:59:57 +00:00
|
|
|
basicAuth = [{{range getBasicAuth $instance}}
|
2017-09-07 15:34:03 +00:00
|
|
|
"{{.}}",
|
2017-12-16 18:22:16 +00:00
|
|
|
{{end}}]
|
|
|
|
|
2017-12-20 21:59:57 +00:00
|
|
|
{{if hasRedirect $instance}}
|
2017-12-16 19:12:44 +00:00
|
|
|
[frontends."frontend-{{ $serviceName }}".redirect]
|
2017-12-20 21:59:57 +00: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 19:12:44 +00:00
|
|
|
{{end}}
|
|
|
|
|
2017-12-16 19:24:30 +00:00
|
|
|
[frontends."frontend-{{ $serviceName }}".headers]
|
2017-12-20 21:59:57 +00:00
|
|
|
{{if hasSSLRedirectHeaders $instance}}
|
|
|
|
SSLRedirect = {{getSSLRedirectHeaders $instance}}
|
2017-12-16 19:24:30 +00:00
|
|
|
{{end}}
|
2017-12-20 21:59:57 +00:00
|
|
|
{{if hasSSLTemporaryRedirectHeaders $instance}}
|
|
|
|
SSLTemporaryRedirect = {{getSSLTemporaryRedirectHeaders $instance}}
|
2017-12-16 19:24:30 +00:00
|
|
|
{{end}}
|
2017-12-20 21:59:57 +00:00
|
|
|
{{if hasSSLHostHeaders $instance}}
|
|
|
|
SSLHost = "{{getSSLHostHeaders $instance}}"
|
2017-12-16 19:24:30 +00:00
|
|
|
{{end}}
|
2017-12-20 21:59:57 +00:00
|
|
|
{{if hasSTSSecondsHeaders $instance}}
|
|
|
|
STSSeconds = {{getSTSSecondsHeaders $instance}}
|
2017-12-16 19:24:30 +00:00
|
|
|
{{end}}
|
2017-12-20 21:59:57 +00:00
|
|
|
{{if hasSTSIncludeSubdomainsHeaders $instance}}
|
|
|
|
STSIncludeSubdomains = {{getSTSIncludeSubdomainsHeaders $instance}}
|
2017-12-16 19:24:30 +00:00
|
|
|
{{end}}
|
2017-12-20 21:59:57 +00:00
|
|
|
{{if hasSTSPreloadHeaders $instance}}
|
|
|
|
STSPreload = {{getSTSPreloadHeaders $instance}}
|
2017-12-16 19:24:30 +00:00
|
|
|
{{end}}
|
2017-12-20 21:59:57 +00:00
|
|
|
{{if hasForceSTSHeaderHeaders $instance}}
|
|
|
|
ForceSTSHeader = {{getForceSTSHeaderHeaders $instance}}
|
2017-12-16 19:24:30 +00:00
|
|
|
{{end}}
|
2017-12-20 21:59:57 +00:00
|
|
|
{{if hasFrameDenyHeaders $instance}}
|
|
|
|
FrameDeny = {{getFrameDenyHeaders $instance}}
|
2017-12-16 19:24:30 +00:00
|
|
|
{{end}}
|
2017-12-20 21:59:57 +00:00
|
|
|
{{if hasCustomFrameOptionsValueHeaders $instance}}
|
|
|
|
CustomFrameOptionsValue = "{{getCustomFrameOptionsValueHeaders $instance}}"
|
2017-12-16 19:24:30 +00:00
|
|
|
{{end}}
|
2017-12-20 21:59:57 +00:00
|
|
|
{{if hasContentTypeNosniffHeaders $instance}}
|
|
|
|
ContentTypeNosniff = {{getContentTypeNosniffHeaders $instance}}
|
2017-12-16 19:24:30 +00:00
|
|
|
{{end}}
|
2017-12-20 21:59:57 +00:00
|
|
|
{{if hasBrowserXSSFilterHeaders $instance}}
|
|
|
|
BrowserXSSFilter = {{getBrowserXSSFilterHeaders $instance}}
|
2017-12-16 19:24:30 +00:00
|
|
|
{{end}}
|
2017-12-20 21:59:57 +00:00
|
|
|
{{if hasContentSecurityPolicyHeaders $instance}}
|
|
|
|
ContentSecurityPolicy = "{{getContentSecurityPolicyHeaders $instance}}"
|
2017-12-16 19:24:30 +00:00
|
|
|
{{end}}
|
2017-12-20 21:59:57 +00:00
|
|
|
{{if hasPublicKeyHeaders $instance}}
|
|
|
|
PublicKey = "{{getPublicKeyHeaders $instance}}"
|
2017-12-16 19:24:30 +00:00
|
|
|
{{end}}
|
2017-12-20 21:59:57 +00:00
|
|
|
{{if hasReferrerPolicyHeaders $instance}}
|
|
|
|
ReferrerPolicy = "{{getReferrerPolicyHeaders $instance}}"
|
2017-12-16 19:24:30 +00:00
|
|
|
{{end}}
|
2017-12-20 21:59:57 +00:00
|
|
|
{{if hasIsDevelopmentHeaders $instance}}
|
|
|
|
IsDevelopment = {{getIsDevelopmentHeaders $instance}}
|
2017-12-16 19:24:30 +00:00
|
|
|
{{end}}
|
2017-12-20 21:59:57 +00:00
|
|
|
{{if hasRequestHeaders $instance}}
|
2017-12-16 19:24:30 +00:00
|
|
|
[frontends."frontend-{{ $serviceName }}".headers.customRequestHeaders]
|
2017-12-20 21:59:57 +00:00
|
|
|
{{range $k, $v := getRequestHeaders $instance}}
|
2017-12-16 19:24:30 +00:00
|
|
|
{{$k}} = "{{$v}}"
|
|
|
|
{{end}}
|
|
|
|
{{end}}
|
2017-12-20 21:59:57 +00:00
|
|
|
{{if hasResponseHeaders $instance}}
|
2017-12-16 19:24:30 +00:00
|
|
|
[frontends."frontend-{{ $serviceName }}".headers.customResponseHeaders]
|
2017-12-20 21:59:57 +00:00
|
|
|
{{range $k, $v := getResponseHeaders $instance}}
|
2017-12-16 19:24:30 +00:00
|
|
|
{{$k}} = "{{$v}}"
|
|
|
|
{{end}}
|
|
|
|
{{end}}
|
2017-12-20 21:59:57 +00:00
|
|
|
{{if hasAllowedHostsHeaders $instance}}
|
2017-12-16 19:24:30 +00:00
|
|
|
[frontends."frontend-{{ $serviceName }}".headers.AllowedHosts]
|
2017-12-20 21:59:57 +00:00
|
|
|
{{range getAllowedHostsHeaders $instance}}
|
2017-12-16 19:24:30 +00:00
|
|
|
"{{.}}"
|
|
|
|
{{end}}
|
|
|
|
{{end}}
|
2017-12-20 21:59:57 +00:00
|
|
|
{{if hasHostsProxyHeaders $instance}}
|
2017-12-16 19:24:30 +00:00
|
|
|
[frontends."frontend-{{ $serviceName }}".headers.HostsProxyHeaders]
|
2017-12-20 21:59:57 +00:00
|
|
|
{{range getHostsProxyHeaders $instance}}
|
2017-12-16 19:24:30 +00:00
|
|
|
"{{.}}"
|
|
|
|
{{end}}
|
|
|
|
{{end}}
|
2017-12-20 21:59:57 +00:00
|
|
|
{{if hasSSLProxyHeaders $instance}}
|
2017-12-16 19:24:30 +00:00
|
|
|
[frontends."frontend-{{ $serviceName }}".headers.SSLProxyHeaders]
|
2017-12-20 21:59:57 +00:00
|
|
|
{{range $k, $v := getSSLProxyHeaders $instance}}
|
2017-12-16 19:24:30 +00:00
|
|
|
{{$k}} = "{{$v}}"
|
|
|
|
{{end}}
|
|
|
|
{{end}}
|
|
|
|
|
2017-08-25 09:42:03 +00:00
|
|
|
[frontends.frontend-{{ $serviceName }}.routes.route-frontend-{{ $serviceName }}]
|
2017-12-20 21:59:57 +00:00
|
|
|
rule = "{{getFrontendRule $instance}}"
|
2017-12-16 18:22:16 +00:00
|
|
|
|
|
|
|
{{end}}
|
2017-08-25 09:42:03 +00:00
|
|
|
{{end}}
|