2017-12-16 15:14:19 +00:00
|
|
|
[backends]
|
2018-01-05 10:53:31 +00:00
|
|
|
{{range $backendName, $backend := .Backends }}
|
2017-12-16 15:14:19 +00:00
|
|
|
|
2018-01-05 10:53:31 +00:00
|
|
|
[backends."{{ $backendName }}"]
|
2017-12-16 15:14:19 +00:00
|
|
|
|
2018-01-05 10:53:31 +00:00
|
|
|
{{if $backend.CircuitBreaker }}
|
2018-03-07 21:10:04 +00:00
|
|
|
[backends."{{ $backendName }}".circuitBreaker]
|
2018-01-05 10:53:31 +00:00
|
|
|
expression = "{{ $backend.CircuitBreaker.Expression }}"
|
2017-02-03 16:47:48 +00:00
|
|
|
{{end}}
|
2017-12-16 15:14:19 +00:00
|
|
|
|
2018-01-05 10:53:31 +00:00
|
|
|
[backends."{{ $backendName }}".loadBalancer]
|
|
|
|
method = "{{ $backend.LoadBalancer.Method }}"
|
|
|
|
sticky = {{ $backend.LoadBalancer.Sticky }}
|
|
|
|
{{if $backend.LoadBalancer.Stickiness }}
|
|
|
|
[backends."{{ $backendName }}".loadBalancer.stickiness]
|
|
|
|
cookieName = "{{ $backend.LoadBalancer.Stickiness.CookieName }}"
|
2017-01-25 13:11:00 +00:00
|
|
|
{{end}}
|
2018-01-31 14:32:04 +00:00
|
|
|
|
2018-01-05 10:53:31 +00:00
|
|
|
{{if $backend.MaxConn }}
|
2018-03-07 21:10:04 +00:00
|
|
|
[backends."{{ $backendName }}".maxConn]
|
2017-12-21 21:44:06 +00:00
|
|
|
amount = {{ $backend.MaxConn.Amount }}
|
|
|
|
extractorFunc = "{{ $backend.MaxConn.ExtractorFunc }}"
|
|
|
|
{{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}}
|
|
|
|
|
2018-01-05 10:53:31 +00:00
|
|
|
{{range $serverName, $server := $backend.Servers }}
|
|
|
|
[backends."{{ $backendName }}".servers."{{ $serverName }}"]
|
|
|
|
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]
|
2018-01-05 10:53:31 +00:00
|
|
|
{{range $frontendName, $frontend := .Frontends }}
|
2017-12-16 15:14:19 +00:00
|
|
|
|
2018-01-05 10:53:31 +00:00
|
|
|
[frontends."{{ $frontendName }}"]
|
|
|
|
backend = "{{ $frontend.Backend }}"
|
|
|
|
priority = {{ $frontend.Priority }}
|
|
|
|
passHostHeader = {{ $frontend.PassHostHeader }}
|
|
|
|
passTLSCert = {{ $frontend.PassTLSCert }}
|
2017-12-16 15:14:19 +00:00
|
|
|
|
2018-01-05 10:53:31 +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
|
|
|
|
2018-01-05 10:53:31 +00:00
|
|
|
basicAuth = [{{range $frontend.BasicAuth }}
|
2017-12-16 15:14:19 +00:00
|
|
|
"{{.}}",
|
|
|
|
{{end}}]
|
|
|
|
|
2018-03-23 16:40:04 +00:00
|
|
|
{{if $frontend.WhiteList }}
|
|
|
|
[frontends."{{ $frontendName }}".whiteList]
|
|
|
|
sourceRange = [{{range $frontend.WhiteList.SourceRange }}
|
|
|
|
"{{.}}",
|
|
|
|
{{end}}]
|
|
|
|
useXForwardedFor = {{ $frontend.WhiteList.UseXForwardedFor }}
|
|
|
|
{{end}}
|
2017-12-16 15:14:19 +00:00
|
|
|
|
2018-01-05 10:53:31 +00:00
|
|
|
{{if $frontend.Redirect }}
|
|
|
|
[frontends."{{ $frontendName }}".redirect]
|
|
|
|
entryPoint = "{{ $frontend.Redirect.EntryPoint }}"
|
|
|
|
regex = "{{ $frontend.Redirect.Regex }}"
|
|
|
|
replacement = "{{ $frontend.Redirect.Replacement }}"
|
2018-05-16 08:46:03 +00:00
|
|
|
permanent = {{ $frontend.Redirect.Permanent }}
|
2017-12-16 15:14:19 +00:00
|
|
|
{{end}}
|
2017-12-15 10:48:03 +00:00
|
|
|
|
2018-01-05 10:53:31 +00:00
|
|
|
{{if $frontend.Errors }}
|
2018-02-23 10:38:02 +00:00
|
|
|
[frontends."{{ $frontendName }}".errors]
|
2018-01-05 10:53:31 +00:00
|
|
|
{{range $pageName, $page := $frontend.Errors }}
|
2018-03-07 21:10:04 +00:00
|
|
|
[frontends."{{ $frontendName }}".errors."{{ $pageName }}"]
|
2018-01-05 10:53:31 +00:00
|
|
|
status = [{{range $page.Status }}
|
2017-12-21 16:47:50 +00:00
|
|
|
"{{.}}",
|
|
|
|
{{end}}]
|
2018-01-05 10:53:31 +00:00
|
|
|
backend = "{{ $page.Backend }}"
|
|
|
|
query = "{{ $page.Query }}"
|
2017-12-21 16:47:50 +00:00
|
|
|
{{end}}
|
|
|
|
{{end}}
|
|
|
|
|
2018-01-05 10:53:31 +00:00
|
|
|
{{if $frontend.RateLimit }}
|
2018-02-23 10:38:02 +00:00
|
|
|
[frontends."{{ $frontendName }}".rateLimit]
|
2017-12-21 21:07:37 +00:00
|
|
|
extractorFunc = "{{ $frontend.RateLimit.ExtractorFunc }}"
|
2018-02-23 10:38:02 +00:00
|
|
|
[frontends."{{ $frontendName }}".rateLimit.rateSet]
|
2018-01-05 10:53:31 +00:00
|
|
|
{{range $limitName, $limit := $frontend.RateLimit.RateSet }}
|
2018-03-07 21:10:04 +00:00
|
|
|
[frontends."{{ $frontendName }}".rateLimit.rateSet."{{ $limitName }}"]
|
2017-12-21 21:07:37 +00:00
|
|
|
period = "{{ $limit.Period }}"
|
|
|
|
average = {{ $limit.Average }}
|
|
|
|
burst = {{ $limit.Burst }}
|
|
|
|
{{end}}
|
|
|
|
{{end}}
|
|
|
|
|
2018-01-02 13:49:11 +00:00
|
|
|
{{if $frontend.Headers }}
|
2018-01-05 10:53:31 +00:00
|
|
|
[frontends."{{ $frontendName }}".headers]
|
|
|
|
SSLRedirect = {{ $frontend.Headers.SSLRedirect }}
|
|
|
|
SSLTemporaryRedirect = {{ $frontend.Headers.SSLTemporaryRedirect }}
|
|
|
|
SSLHost = "{{ $frontend.Headers.SSLHost }}"
|
2018-05-14 09:44:03 +00:00
|
|
|
SSLForceHost = {{ $frontend.Headers.SSLForceHost }}
|
2018-01-05 10:53:31 +00:00
|
|
|
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 }}
|
2018-03-02 13:24:03 +00:00
|
|
|
CustomBrowserXSSValue = "{{ $frontend.Headers.CustomBrowserXSSValue }}"
|
2018-01-05 10:53:31 +00:00
|
|
|
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 }}
|
2017-12-16 15:14:19 +00:00
|
|
|
"{{.}}",
|
|
|
|
{{end}}]
|
|
|
|
{{end}}
|
2018-01-05 10:53:31 +00:00
|
|
|
{{if $frontend.Headers.HostsProxyHeaders }}
|
|
|
|
HostsProxyHeaders = [{{range $frontend.Headers.HostsProxyHeaders }}
|
2017-12-16 15:14:19 +00:00
|
|
|
"{{.}}",
|
|
|
|
{{end}}]
|
|
|
|
{{end}}
|
2018-01-05 10:53:31 +00:00
|
|
|
{{if $frontend.Headers.CustomRequestHeaders }}
|
|
|
|
[frontends."{{ $frontendName }}".headers.customRequestHeaders]
|
|
|
|
{{range $k, $v := $frontend.Headers.CustomRequestHeaders }}
|
|
|
|
{{ $k }} = "{{ $v }}"
|
2017-12-16 15:14:19 +00:00
|
|
|
{{end}}
|
2017-11-28 12:36:03 +00:00
|
|
|
{{end}}
|
2018-01-05 10:53:31 +00:00
|
|
|
{{if $frontend.Headers.CustomResponseHeaders }}
|
|
|
|
[frontends."{{ $frontendName }}".headers.customResponseHeaders]
|
|
|
|
{{range $k, $v := $frontend.Headers.CustomResponseHeaders }}
|
|
|
|
{{ $k }} = "{{ $v }}"
|
2017-12-16 15:14:19 +00:00
|
|
|
{{end}}
|
2017-11-28 12:36:03 +00:00
|
|
|
{{end}}
|
2018-01-05 10:53:31 +00:00
|
|
|
{{if $frontend.Headers.SSLProxyHeaders }}
|
|
|
|
[frontends."{{ $frontendName }}".headers.SSLProxyHeaders]
|
|
|
|
{{range $k, $v := $frontend.Headers.SSLProxyHeaders }}
|
|
|
|
{{ $k }} = "{{ $v }}"
|
2017-12-16 15:14:19 +00:00
|
|
|
{{end}}
|
2017-11-28 12:36:03 +00:00
|
|
|
{{end}}
|
2017-12-16 15:14:19 +00:00
|
|
|
{{end}}
|
|
|
|
|
2018-01-05 10:53:31 +00:00
|
|
|
{{range $routeName, $route := $frontend.Routes }}
|
|
|
|
[frontends."{{ $frontendName }}".routes."{{ $routeName }}"]
|
|
|
|
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}}
|