2016-02-08 20:57:32 +00:00
|
|
|
[backends]{{range $backendName, $backend := .Backends}}
|
2017-05-15 21:16:35 +00:00
|
|
|
[backends."{{$backendName}}"]
|
2017-02-03 16:47:48 +00:00
|
|
|
{{if $backend.CircuitBreaker}}
|
|
|
|
[backends."{{$backendName}}".circuitbreaker]
|
|
|
|
expression = "{{$backend.CircuitBreaker.Expression}}"
|
|
|
|
{{end}}
|
2017-01-25 13:11:00 +00:00
|
|
|
[backends."{{$backendName}}".loadbalancer]
|
|
|
|
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-10-16 15:38:03 +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}}
|
2016-02-08 20:57:32 +00:00
|
|
|
{{range $serverName, $server := $backend.Servers}}
|
|
|
|
[backends."{{$backendName}}".servers."{{$serverName}}"]
|
|
|
|
url = "{{$server.URL}}"
|
|
|
|
weight = {{$server.Weight}}
|
|
|
|
{{end}}
|
|
|
|
{{end}}
|
|
|
|
|
|
|
|
[frontends]{{range $frontendName, $frontend := .Frontends}}
|
|
|
|
[frontends."{{$frontendName}}"]
|
|
|
|
backend = "{{$frontend.Backend}}"
|
2016-08-02 23:48:53 +00:00
|
|
|
priority = {{$frontend.Priority}}
|
2016-05-10 11:43:24 +00:00
|
|
|
passHostHeader = {{$frontend.PassHostHeader}}
|
2017-12-20 09:26:03 +00:00
|
|
|
entryPoints = [{{range $frontend.EntryPoints}}
|
|
|
|
"{{.}}",
|
|
|
|
{{end}}]
|
2017-04-23 14:17:20 +00:00
|
|
|
basicAuth = [{{range $frontend.BasicAuth}}
|
|
|
|
"{{.}}",
|
2017-04-30 09:22:07 +00:00
|
|
|
{{end}}]
|
|
|
|
whitelistSourceRange = [{{range $frontend.WhitelistSourceRange}}
|
|
|
|
"{{.}}",
|
2017-04-23 14:17:20 +00:00
|
|
|
{{end}}]
|
2017-12-15 10:48:03 +00:00
|
|
|
|
|
|
|
{{if $frontend.Redirect}}
|
|
|
|
[frontends."{{$frontendName}}".redirect]
|
2018-01-24 07:12:03 +00:00
|
|
|
entryPoint = "{{$frontend.Redirect.EntryPoint}}"
|
|
|
|
regex = "{{$frontend.Redirect.Regex}}"
|
|
|
|
replacement = "{{$frontend.Redirect.Replacement}}"
|
2017-12-15 10:48:03 +00:00
|
|
|
{{end}}
|
|
|
|
|
2018-01-02 13:49:11 +00:00
|
|
|
{{if $frontend.Headers }}
|
2017-11-28 12:36:03 +00:00
|
|
|
[frontends."{{$frontendName}}".headers]
|
|
|
|
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}}
|
2018-01-02 08:42:03 +00:00
|
|
|
{{if $frontend.Headers.AllowedHosts}}
|
|
|
|
AllowedHosts = [{{range $frontend.Headers.AllowedHosts}}
|
|
|
|
"{{.}}",
|
|
|
|
{{end}}]
|
|
|
|
{{end}}
|
|
|
|
{{if $frontend.Headers.HostsProxyHeaders}}
|
|
|
|
HostsProxyHeaders = [{{range $frontend.Headers.HostsProxyHeaders}}
|
|
|
|
"{{.}}",
|
|
|
|
{{end}}]
|
|
|
|
{{end}}
|
2017-11-28 12:36:03 +00:00
|
|
|
{{if $frontend.Headers.CustomRequestHeaders}}
|
|
|
|
[frontends."{{$frontendName}}".headers.customrequestheaders]
|
|
|
|
{{range $k, $v := $frontend.Headers.CustomRequestHeaders}}
|
|
|
|
{{$k}} = "{{$v}}"
|
|
|
|
{{end}}
|
|
|
|
{{end}}
|
|
|
|
{{if $frontend.Headers.CustomResponseHeaders}}
|
|
|
|
[frontends."{{$frontendName}}".headers.customresponseheaders]
|
|
|
|
{{range $k, $v := $frontend.Headers.CustomResponseHeaders}}
|
|
|
|
{{$k}} = "{{$v}}"
|
|
|
|
{{end}}
|
|
|
|
{{end}}
|
|
|
|
{{if $frontend.Headers.SSLProxyHeaders}}
|
|
|
|
[frontends."{{$frontendName}}".headers.SSLProxyHeaders]
|
|
|
|
{{range $k, $v := $frontend.Headers.SSLProxyHeaders}}
|
|
|
|
{{$k}} = "{{$v}}"
|
|
|
|
{{end}}
|
|
|
|
{{end}}
|
|
|
|
{{end}}
|
2016-02-08 20:57:32 +00:00
|
|
|
{{range $routeName, $route := $frontend.Routes}}
|
|
|
|
[frontends."{{$frontendName}}".routes."{{$routeName}}"]
|
2016-04-20 11:26:51 +00:00
|
|
|
rule = "{{$route.Rule}}"
|
2016-02-08 20:57:32 +00:00
|
|
|
{{end}}
|
2018-01-07 23:36:03 +00:00
|
|
|
{{end}}
|
|
|
|
|
2018-01-24 10:57:06 +00:00
|
|
|
{{range $tls := .TLS}}
|
|
|
|
[[tls]]
|
|
|
|
entryPoints = [{{range $tls.EntryPoints}}
|
2018-01-07 23:36:03 +00:00
|
|
|
"{{.}}",
|
|
|
|
{{end}}]
|
2018-01-24 10:57:06 +00:00
|
|
|
[tls.certificate]
|
|
|
|
certFile = """{{$tls.Certificate.CertFile}}"""
|
|
|
|
keyFile = """{{$tls.Certificate.KeyFile}}"""
|
2018-01-07 23:36:03 +00:00
|
|
|
{{end}}
|