2017-12-16 15:14:19 +00:00
|
|
|
[backends]
|
|
|
|
{{range $backendName, $backend := .Backends}}
|
|
|
|
|
|
|
|
[backends."{{$backendName}}"]
|
|
|
|
|
2017-02-03 16:47:48 +00:00
|
|
|
{{if $backend.CircuitBreaker}}
|
2017-12-16 15:14:19 +00:00
|
|
|
[backends."{{$backendName}}".circuitBreaker]
|
2017-02-03 16:47:48 +00:00
|
|
|
expression = "{{$backend.CircuitBreaker.Expression}}"
|
|
|
|
{{end}}
|
2017-12-16 15:14:19 +00:00
|
|
|
|
|
|
|
[backends."{{$backendName}}".loadBalancer]
|
2017-01-25 13:11:00 +00:00
|
|
|
method = "{{$backend.LoadBalancer.Method}}"
|
2017-10-16 15:38:03 +00:00
|
|
|
{{if $backend.LoadBalancer.Sticky}}
|
|
|
|
sticky = true
|
|
|
|
{{end}}
|
2017-10-10 09:10:02 +00:00
|
|
|
{{if $backend.LoadBalancer.Stickiness}}
|
2017-12-16 15:14:19 +00:00
|
|
|
[backends."{{$backendName}}".loadBalancer.stickiness]
|
2017-10-12 15:50:03 +00:00
|
|
|
cookieName = "{{$backend.LoadBalancer.Stickiness.CookieName}}"
|
2017-01-25 13:11:00 +00:00
|
|
|
{{end}}
|
2018-01-31 14:32:04 +00:00
|
|
|
|
|
|
|
{{if $backend.Buffering }}
|
|
|
|
[backends."{{ $backendName }}".buffering]
|
|
|
|
maxRequestBodyBytes = {{ $backend.Buffering.MaxRequestBodyBytes }}
|
|
|
|
memRequestBodyBytes = {{ $backend.Buffering.MemRequestBodyBytes }}
|
|
|
|
maxResponseBodyBytes = {{ $backend.Buffering.MaxResponseBodyBytes }}
|
|
|
|
memResponseBodyBytes = {{ $backend.Buffering.MemResponseBodyBytes }}
|
|
|
|
retryExpression = "{{ $backend.Buffering.RetryExpression }}"
|
|
|
|
{{end}}
|
|
|
|
|
2016-02-08 20:57:32 +00:00
|
|
|
{{range $serverName, $server := $backend.Servers}}
|
|
|
|
[backends."{{$backendName}}".servers."{{$serverName}}"]
|
2017-12-16 15:14:19 +00:00
|
|
|
url = "{{$server.URL}}"
|
|
|
|
weight = {{$server.Weight}}
|
2016-02-08 20:57:32 +00:00
|
|
|
{{end}}
|
2017-12-16 15:14:19 +00:00
|
|
|
|
2016-02-08 20:57:32 +00:00
|
|
|
{{end}}
|
|
|
|
|
2017-12-16 15:14:19 +00:00
|
|
|
[frontends]
|
|
|
|
{{range $frontendName, $frontend := .Frontends}}
|
|
|
|
|
2016-02-08 20:57:32 +00:00
|
|
|
[frontends."{{$frontendName}}"]
|
2017-12-16 15:14:19 +00:00
|
|
|
backend = "{{$frontend.Backend}}"
|
|
|
|
priority = {{$frontend.Priority}}
|
|
|
|
passHostHeader = {{$frontend.PassHostHeader}}
|
2017-12-21 14:54:27 +00:00
|
|
|
passTLSCert = {{$frontend.PassTLSCert}}
|
2017-12-16 15:14:19 +00:00
|
|
|
|
|
|
|
entryPoints = [{{range $frontend.EntryPoints}}
|
2017-04-23 14:17:20 +00:00
|
|
|
"{{.}}",
|
2017-12-16 15:14:19 +00:00
|
|
|
{{end}}]
|
2017-12-15 10:48:03 +00:00
|
|
|
|
2017-12-16 15:14:19 +00:00
|
|
|
basicAuth = [{{range $frontend.BasicAuth}}
|
|
|
|
"{{.}}",
|
|
|
|
{{end}}]
|
|
|
|
|
|
|
|
whitelistSourceRange = [{{range $frontend.WhitelistSourceRange}}
|
|
|
|
"{{.}}",
|
|
|
|
{{end}}]
|
|
|
|
|
|
|
|
{{if $frontend.Redirect}}
|
|
|
|
[frontends."{{$frontendName}}".redirect]
|
|
|
|
entryPoint = "{{$frontend.RedirectEntryPoint}}"
|
|
|
|
regex = "{{$frontend.RedirectRegex}}"
|
|
|
|
replacement = "{{$frontend.RedirectReplacement}}"
|
|
|
|
{{end}}
|
2017-12-15 10:48:03 +00:00
|
|
|
|
2017-12-21 16:47:50 +00:00
|
|
|
{{ if $frontend.Errors }}
|
|
|
|
[frontends."frontend-{{$frontendName}}".errors]
|
|
|
|
{{ range $pageName, $page := $frontend.Errors }}
|
|
|
|
[frontends."frontend-{{$frontendName}}".errors.{{ $pageName }}]
|
|
|
|
status = [{{range $page.Status}}
|
|
|
|
"{{.}}",
|
|
|
|
{{end}}]
|
|
|
|
backend = "{{$page.Backend}}"
|
|
|
|
query = "{{$page.Query}}"
|
|
|
|
{{end}}
|
|
|
|
{{end}}
|
|
|
|
|
2018-01-02 13:49:11 +00:00
|
|
|
{{if $frontend.Headers }}
|
2017-11-28 12:36:03 +00:00
|
|
|
[frontends."{{$frontendName}}".headers]
|
2017-12-16 15:14:19 +00:00
|
|
|
SSLRedirect = {{$frontend.Headers.SSLRedirect}}
|
|
|
|
SSLTemporaryRedirect = {{$frontend.Headers.SSLTemporaryRedirect}}
|
|
|
|
SSLHost = "{{$frontend.Headers.SSLHost}}"
|
|
|
|
STSSeconds = {{$frontend.Headers.STSSeconds}}
|
|
|
|
STSIncludeSubdomains = {{$frontend.Headers.STSIncludeSubdomains}}
|
|
|
|
STSPreload = {{$frontend.Headers.STSPreload}}
|
|
|
|
ForceSTSHeader = {{$frontend.Headers.ForceSTSHeader}}
|
|
|
|
FrameDeny = {{$frontend.Headers.FrameDeny}}
|
|
|
|
CustomFrameOptionsValue = "{{$frontend.Headers.CustomFrameOptionsValue}}"
|
|
|
|
ContentTypeNosniff = {{$frontend.Headers.ContentTypeNosniff}}
|
|
|
|
BrowserXSSFilter = {{$frontend.Headers.BrowserXSSFilter}}
|
|
|
|
ContentSecurityPolicy = "{{$frontend.Headers.ContentSecurityPolicy}}"
|
|
|
|
PublicKey = "{{$frontend.Headers.PublicKey}}"
|
|
|
|
ReferrerPolicy = "{{$frontend.Headers.ReferrerPolicy}}"
|
|
|
|
IsDevelopment = {{$frontend.Headers.IsDevelopment}}
|
|
|
|
{{if $frontend.Headers.AllowedHosts}}
|
|
|
|
AllowedHosts = [{{range $frontend.Headers.AllowedHosts}}
|
|
|
|
"{{.}}",
|
|
|
|
{{end}}]
|
|
|
|
{{end}}
|
|
|
|
{{if $frontend.Headers.HostsProxyHeaders}}
|
|
|
|
HostsProxyHeaders = [{{range $frontend.Headers.HostsProxyHeaders}}
|
|
|
|
"{{.}}",
|
|
|
|
{{end}}]
|
|
|
|
{{end}}
|
|
|
|
{{if $frontend.Headers.CustomRequestHeaders}}
|
2017-11-28 12:36:03 +00:00
|
|
|
[frontends."{{$frontendName}}".headers.customrequestheaders]
|
2017-12-16 15:14:19 +00:00
|
|
|
{{range $k, $v := $frontend.Headers.CustomRequestHeaders}}
|
|
|
|
{{$k}} = "{{$v}}"
|
|
|
|
{{end}}
|
2017-11-28 12:36:03 +00:00
|
|
|
{{end}}
|
2017-12-16 15:14:19 +00:00
|
|
|
{{if $frontend.Headers.CustomResponseHeaders}}
|
2017-11-28 12:36:03 +00:00
|
|
|
[frontends."{{$frontendName}}".headers.customresponseheaders]
|
2017-12-16 15:14:19 +00:00
|
|
|
{{range $k, $v := $frontend.Headers.CustomResponseHeaders}}
|
|
|
|
{{$k}} = "{{$v}}"
|
|
|
|
{{end}}
|
2017-11-28 12:36:03 +00:00
|
|
|
{{end}}
|
2017-12-16 15:14:19 +00:00
|
|
|
{{if $frontend.Headers.SSLProxyHeaders}}
|
2017-11-28 12:36:03 +00:00
|
|
|
[frontends."{{$frontendName}}".headers.SSLProxyHeaders]
|
2017-12-16 15:14:19 +00:00
|
|
|
{{range $k, $v := $frontend.Headers.SSLProxyHeaders}}
|
|
|
|
{{$k}} = "{{$v}}"
|
|
|
|
{{end}}
|
2017-11-28 12:36:03 +00:00
|
|
|
{{end}}
|
2017-12-16 15:14:19 +00:00
|
|
|
{{end}}
|
|
|
|
|
2016-02-08 20:57:32 +00:00
|
|
|
{{range $routeName, $route := $frontend.Routes}}
|
|
|
|
[frontends."{{$frontendName}}".routes."{{$routeName}}"]
|
2017-12-16 15:14:19 +00:00
|
|
|
rule = "{{$route.Rule}}"
|
2016-02-08 20:57:32 +00:00
|
|
|
{{end}}
|
2017-12-16 15:14:19 +00:00
|
|
|
|
2018-01-07 23:36:03 +00:00
|
|
|
{{end}}
|
|
|
|
|
2017-12-16 15:14:19 +00:00
|
|
|
{{range $tls := .TLS }}
|
2018-01-24 10:57:06 +00:00
|
|
|
[[tls]]
|
2017-12-16 15:14:19 +00:00
|
|
|
entryPoints = [{{range $tls.EntryPoints }}
|
2018-01-07 23:36:03 +00:00
|
|
|
"{{.}}",
|
2017-12-16 15:14:19 +00:00
|
|
|
{{end}}]
|
2018-01-24 10:57:06 +00:00
|
|
|
[tls.certificate]
|
2017-12-16 15:14:19 +00:00
|
|
|
certFile = """{{ $tls.Certificate.CertFile }}"""
|
|
|
|
keyFile = """{{ $tls.Certificate.KeyFile }}"""
|
2018-01-07 23:36:03 +00:00
|
|
|
{{end}}
|