2015-09-10 14:14:08 +00:00
|
|
|
{{$apps := .Applications}}
|
2017-05-22 21:21:15 +00:00
|
|
|
|
2017-12-16 13:47:03 +00:00
|
|
|
[backends]
|
2017-05-22 21:21:15 +00:00
|
|
|
{{range $app := $apps}}
|
2017-08-21 08:46:03 +00:00
|
|
|
{{range $serviceIndex, $serviceName := getServiceNames $app}}
|
2017-12-16 13:47:03 +00:00
|
|
|
|
|
|
|
[backends."{{getBackend $app $serviceName }}"]
|
|
|
|
|
|
|
|
{{ if hasCircuitBreakerLabels $app }}
|
|
|
|
[backends."{{getBackend $app $serviceName }}".circuitBreaker]
|
|
|
|
expression = "{{getCircuitBreakerExpression $app }}"
|
|
|
|
{{end}}
|
|
|
|
|
|
|
|
{{ if hasLoadBalancerLabels $app }}
|
|
|
|
[backends."{{getBackend $app $serviceName }}".loadBalancer]
|
|
|
|
method = "{{getLoadBalancerMethod $app }}"
|
|
|
|
sticky = {{getSticky $app}}
|
|
|
|
{{if hasStickinessLabel $app}}
|
|
|
|
[backends."{{getBackend $app $serviceName }}".loadBalancer.stickiness]
|
|
|
|
cookieName = "{{getStickinessCookieName $app}}"
|
|
|
|
{{end}}
|
|
|
|
{{end}}
|
|
|
|
|
|
|
|
{{ if hasMaxConnLabels $app }}
|
|
|
|
[backends."{{getBackend $app $serviceName }}".maxConn]
|
|
|
|
amount = {{getMaxConnAmount $app }}
|
|
|
|
extractorFunc = "{{getMaxConnExtractorFunc $app }}"
|
|
|
|
{{end}}
|
|
|
|
|
|
|
|
{{ if hasHealthCheckLabels $app }}
|
|
|
|
[backends."{{getBackend $app $serviceName }}".healthCheck]
|
|
|
|
path = "{{getHealthCheckPath $app }}"
|
2017-12-16 13:47:49 +00:00
|
|
|
port = {{getHealthCheckPort $app}}
|
2017-12-16 13:47:03 +00:00
|
|
|
interval = "{{getHealthCheckInterval $app }}"
|
|
|
|
{{end}}
|
|
|
|
|
2017-05-22 21:21:15 +00:00
|
|
|
{{end}}
|
2017-12-16 13:47:03 +00:00
|
|
|
|
|
|
|
{{range $task := $app.Tasks}}
|
|
|
|
{{range $serviceIndex, $serviceName := getServiceNames $app}}
|
|
|
|
|
|
|
|
[backends."{{getBackend $app $serviceName}}".servers."server-{{$task.ID | replace "." "-"}}{{getServiceNameSuffix $serviceName }}"]
|
|
|
|
url = "{{getProtocol $app $serviceName}}://{{getBackendServer $task $app}}:{{getPort $task $app $serviceName}}"
|
|
|
|
weight = {{getWeight $app $serviceName}}
|
|
|
|
|
|
|
|
{{end}}
|
|
|
|
{{end}}
|
|
|
|
|
2015-09-09 20:39:08 +00:00
|
|
|
{{end}}
|
|
|
|
|
2017-12-16 13:47:03 +00:00
|
|
|
[frontends]
|
2017-08-21 08:46:03 +00:00
|
|
|
{{range $app := $apps}}
|
2017-12-16 13:47:03 +00:00
|
|
|
{{range $serviceIndex, $serviceName := getServiceNames .}}
|
2016-08-13 16:55:15 +00:00
|
|
|
|
2017-08-21 08:46:03 +00:00
|
|
|
[frontends."{{ getFrontendName $app $serviceName }}"]
|
2017-12-16 13:47:03 +00:00
|
|
|
backend = "{{getBackend $app $serviceName}}"
|
|
|
|
priority = {{getPriority $app $serviceName}}
|
|
|
|
passHostHeader = {{getPassHostHeader $app $serviceName}}
|
2017-12-16 13:58:36 +00:00
|
|
|
passTLSCert = {{getPassTLSCert $app $serviceName}}
|
2017-12-16 13:47:03 +00:00
|
|
|
|
|
|
|
entryPoints = [{{range getEntryPoints $app $serviceName}}
|
|
|
|
"{{.}}",
|
|
|
|
{{end}}]
|
|
|
|
|
2017-12-16 14:01:45 +00:00
|
|
|
{{if getWhitelistSourceRange $app $serviceName}}
|
|
|
|
whitelistSourceRange = [{{range getWhitelistSourceRange $app $serviceName}}
|
|
|
|
"{{.}}",
|
|
|
|
{{end}}]
|
|
|
|
{{end}}
|
|
|
|
|
2017-12-16 13:47:03 +00:00
|
|
|
basicAuth = [{{range getBasicAuth $app $serviceName}}
|
|
|
|
"{{.}}",
|
|
|
|
{{end}}]
|
|
|
|
|
2017-12-16 14:15:49 +00:00
|
|
|
{{if hasRedirect $app $serviceName}}
|
|
|
|
[frontends."{{ getFrontendName $app $serviceName }}".redirect]
|
|
|
|
entryPoint = "{{getRedirectEntryPoint $app $serviceName}}"
|
|
|
|
regex = "{{getRedirectRegex $app $serviceName}}"
|
|
|
|
replacement = "{{getRedirectReplacement $app $serviceName}}"
|
|
|
|
{{end}}
|
|
|
|
|
2017-12-20 15:33:57 +00:00
|
|
|
{{ if hasErrorPages $app $serviceName }}
|
|
|
|
[frontends."{{ getFrontendName $app $serviceName }}".errors]
|
|
|
|
{{ range $pageName, $page := getErrorPages $app $serviceName }}
|
|
|
|
[frontends."{{ getFrontendName $app $serviceName }}".errors.{{ $pageName }}]
|
|
|
|
status = [{{range $page.Status}}
|
|
|
|
"{{.}}",
|
|
|
|
{{end}}]
|
|
|
|
backend = "{{$page.Backend}}"
|
|
|
|
query = "{{$page.Query}}"
|
|
|
|
{{end}}
|
|
|
|
{{end}}
|
|
|
|
|
|
|
|
{{ if hasRateLimits $app $serviceName }}
|
|
|
|
[frontends."{{ getFrontendName $app $serviceName }}".rateLimit]
|
|
|
|
extractorFunc = "{{ getRateLimitsExtractorFunc $app $serviceName }}"
|
|
|
|
[frontends."{{ getFrontendName $app $serviceName }}".rateLimit.rateSet]
|
|
|
|
{{ range $limitName, $rateLimit := getRateLimits $app $serviceName }}
|
|
|
|
[frontends."{{ getFrontendName $app $serviceName }}".rateLimit.rateSet.{{ $limitName }}]
|
|
|
|
period = "{{ $rateLimit.Period }}"
|
|
|
|
average = {{ $rateLimit.Average }}
|
|
|
|
burst = {{ $rateLimit.Burst }}
|
|
|
|
{{end}}
|
|
|
|
{{end}}
|
|
|
|
|
2018-01-02 13:49:11 +00:00
|
|
|
{{if hasHeaders $app $serviceName }}
|
2017-12-20 15:33:57 +00:00
|
|
|
[frontends."{{ getFrontendName $app $serviceName }}".headers]
|
2018-01-02 08:42:03 +00:00
|
|
|
{{if hasSSLRedirectHeaders $app $serviceName}}
|
|
|
|
SSLRedirect = {{getSSLRedirectHeaders $app $serviceName}}
|
|
|
|
{{end}}
|
|
|
|
{{if hasSSLTemporaryRedirectHeaders $app $serviceName}}
|
|
|
|
SSLTemporaryRedirect = {{getSSLTemporaryRedirectHeaders $app $serviceName}}
|
|
|
|
{{end}}
|
|
|
|
{{if hasSSLHostHeaders $app $serviceName}}
|
|
|
|
SSLHost = "{{getSSLHostHeaders $app $serviceName}}"
|
|
|
|
{{end}}
|
|
|
|
{{if hasSTSSecondsHeaders $app $serviceName}}
|
|
|
|
STSSeconds = {{getSTSSecondsHeaders $app $serviceName}}
|
|
|
|
{{end}}
|
|
|
|
{{if hasSTSIncludeSubdomainsHeaders $app $serviceName}}
|
|
|
|
STSIncludeSubdomains = {{getSTSIncludeSubdomainsHeaders $app $serviceName}}
|
|
|
|
{{end}}
|
|
|
|
{{if hasSTSPreloadHeaders $app $serviceName}}
|
|
|
|
STSPreload = {{getSTSPreloadHeaders $app $serviceName}}
|
|
|
|
{{end}}
|
|
|
|
{{if hasForceSTSHeaderHeaders $app $serviceName}}
|
|
|
|
ForceSTSHeader = {{getForceSTSHeaderHeaders $app $serviceName}}
|
|
|
|
{{end}}
|
|
|
|
{{if hasFrameDenyHeaders $app $serviceName}}
|
|
|
|
FrameDeny = {{getFrameDenyHeaders $app $serviceName}}
|
|
|
|
{{end}}
|
|
|
|
{{if hasCustomFrameOptionsValueHeaders $app $serviceName}}
|
|
|
|
CustomFrameOptionsValue = "{{getCustomFrameOptionsValueHeaders $app $serviceName}}"
|
|
|
|
{{end}}
|
|
|
|
{{if hasContentTypeNosniffHeaders $app $serviceName}}
|
|
|
|
ContentTypeNosniff = {{getContentTypeNosniffHeaders $app $serviceName}}
|
|
|
|
{{end}}
|
|
|
|
{{if hasBrowserXSSFilterHeaders $app $serviceName}}
|
|
|
|
BrowserXSSFilter = {{getBrowserXSSFilterHeaders $app $serviceName}}
|
|
|
|
{{end}}
|
|
|
|
{{if hasContentSecurityPolicyHeaders $app $serviceName}}
|
|
|
|
ContentSecurityPolicy = "{{getContentSecurityPolicyHeaders $app $serviceName}}"
|
|
|
|
{{end}}
|
|
|
|
{{if hasPublicKeyHeaders $app $serviceName}}
|
|
|
|
PublicKey = "{{getPublicKeyHeaders $app $serviceName}}"
|
|
|
|
{{end}}
|
|
|
|
{{if hasReferrerPolicyHeaders $app $serviceName}}
|
|
|
|
ReferrerPolicy = "{{getReferrerPolicyHeaders $app $serviceName}}"
|
|
|
|
{{end}}
|
|
|
|
{{if hasIsDevelopmentHeaders $app $serviceName}}
|
|
|
|
IsDevelopment = {{getIsDevelopmentHeaders $app $serviceName}}
|
|
|
|
{{end}}
|
|
|
|
|
|
|
|
{{if hasAllowedHostsHeaders $app $serviceName}}
|
|
|
|
AllowedHosts = [{{range getAllowedHostsHeaders $app $serviceName}}
|
|
|
|
"{{.}}",
|
|
|
|
{{end}}]
|
|
|
|
{{end}}
|
|
|
|
|
|
|
|
{{if hasHostsProxyHeaders $app $serviceName}}
|
|
|
|
HostsProxyHeaders = [{{range getHostsProxyHeaders $app $serviceName}}
|
|
|
|
"{{.}}",
|
|
|
|
{{end}}]
|
|
|
|
{{end}}
|
|
|
|
|
|
|
|
{{if hasRequestHeaders $app $serviceName}}
|
|
|
|
[frontends."{{ getFrontendName $app $serviceName }}".headers.customRequestHeaders]
|
|
|
|
{{range $k, $v := getRequestHeaders $app $serviceName}}
|
|
|
|
{{$k}} = "{{$v}}"
|
2017-12-16 14:36:17 +00:00
|
|
|
{{end}}
|
2018-01-02 08:42:03 +00:00
|
|
|
{{end}}
|
|
|
|
|
|
|
|
{{if hasResponseHeaders $app $serviceName}}
|
|
|
|
[frontends."{{ getFrontendName $app $serviceName }}".headers.customResponseHeaders]
|
|
|
|
{{range $k, $v := getResponseHeaders $app $serviceName}}
|
|
|
|
{{$k}} = "{{$v}}"
|
2017-12-16 14:36:17 +00:00
|
|
|
{{end}}
|
2018-01-02 08:42:03 +00:00
|
|
|
{{end}}
|
|
|
|
|
|
|
|
{{if hasSSLProxyHeaders $app $serviceName}}
|
|
|
|
[frontends."{{ getFrontendName $app $serviceName }}".headers.SSLProxyHeaders]
|
|
|
|
{{range $k, $v := getSSLProxyHeaders $app $serviceName}}
|
|
|
|
{{$k}} = "{{$v}}"
|
2017-12-16 14:36:17 +00:00
|
|
|
{{end}}
|
2018-01-02 08:42:03 +00:00
|
|
|
{{end}}
|
2018-01-02 13:49:11 +00:00
|
|
|
{{end}}
|
2017-12-16 14:36:17 +00:00
|
|
|
|
2018-01-02 08:42:03 +00:00
|
|
|
[frontends."{{ getFrontendName $app $serviceName }}".routes."route-host{{$app.ID | replace "/" "-"}}{{getServiceNameSuffix $serviceName }}"]
|
|
|
|
rule = "{{getFrontendRule $app $serviceName}}"
|
2017-12-16 13:47:03 +00:00
|
|
|
|
|
|
|
{{end}}
|
|
|
|
{{end}}
|