2017-12-16 18:14:19 +03:00
[backends]
2018-01-05 13:53:31 +03:00
{{range $ backendName , $ backend := .Backends }}
2017-12-16 18:14:19 +03:00
2018-01-05 13:53:31 +03:00
[backends."{{ $ backendName }}"]
2017-12-16 18:14:19 +03:00
2018-01-05 13:53:31 +03:00
{{if $ backend . CircuitBreaker }}
[backends."{{ $ backendName }} ".circuitBreaker]
expression = "{{ $ backend . CircuitBreaker . Expression }}"
2017-02-03 19:47:48 +03:00
{{end}}
2017-12-16 18:14:19 +03:00
2018-01-05 13:53:31 +03: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 16:11:00 +03:00
{{end}}
2018-01-31 17:32:04 +03:00
2018-01-05 13:53:31 +03:00
{{if $ backend . MaxConn }}
[backends.backend-{{ $ backendName }}.maxConn]
2017-12-22 00:44:06 +03:00
amount = {{ $ backend . MaxConn . Amount }}
extractorFunc = "{{ $ backend . MaxConn . ExtractorFunc }}"
{{end}}
2018-01-31 17:32:04 +03: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 13:53:31 +03:00
{{range $ serverName , $ server := $ backend . Servers }}
[backends."{{ $ backendName }}".servers."{{ $ serverName }}"]
url = "{{ $ server . URL }}"
weight = {{ $ server . Weight }}
2016-02-08 23:57:32 +03:00
{{end}}
2017-12-16 18:14:19 +03:00
2016-02-08 23:57:32 +03:00
{{end}}
2017-12-16 18:14:19 +03:00
[frontends]
2018-01-05 13:53:31 +03:00
{{range $ frontendName , $ frontend := .Frontends }}
2017-12-16 18:14:19 +03:00
2018-01-05 13:53:31 +03:00
[frontends."{{ $ frontendName }}"]
backend = "{{ $ frontend . Backend }}"
priority = {{ $ frontend . Priority }}
passHostHeader = {{ $ frontend . PassHostHeader }}
passTLSCert = {{ $ frontend . PassTLSCert }}
2017-12-16 18:14:19 +03:00
2018-01-05 13:53:31 +03:00
entryPoints = [{{range $ frontend . EntryPoints }}
2017-04-23 17:17:20 +03:00
"{{.}}",
2017-12-16 18:14:19 +03:00
{{end}}]
2017-12-15 13:48:03 +03:00
2018-01-05 13:53:31 +03:00
basicAuth = [{{range $ frontend . BasicAuth }}
2017-12-16 18:14:19 +03:00
"{{.}}",
{{end}}]
2018-01-05 13:53:31 +03:00
whitelistSourceRange = [{{range $ frontend . WhitelistSourceRange }}
2017-12-16 18:14:19 +03:00
"{{.}}",
{{end}}]
2018-01-05 13:53:31 +03:00
{{if $ frontend . Redirect }}
[frontends."{{ $ frontendName }}".redirect]
entryPoint = "{{ $ frontend . Redirect . EntryPoint }}"
regex = "{{ $ frontend . Redirect . Regex }}"
replacement = "{{ $ frontend . Redirect . Replacement }}"
2017-12-16 18:14:19 +03:00
{{end}}
2017-12-15 13:48:03 +03:00
2018-01-05 13:53:31 +03:00
{{if $ frontend . Errors }}
2018-02-23 13:38:02 +03:00
[frontends."{{ $ frontendName }}".errors]
2018-01-05 13:53:31 +03:00
{{range $ pageName , $ page := $ frontend . Errors }}
2018-02-23 13:38:02 +03:00
[frontends."{{ $ frontendName }}".errors.{{ $ pageName }}]
2018-01-05 13:53:31 +03:00
status = [{{range $ page . Status }}
2017-12-21 19:47:50 +03:00
"{{.}}",
{{end}}]
2018-01-05 13:53:31 +03:00
backend = "{{ $ page . Backend }}"
query = "{{ $ page . Query }}"
2017-12-21 19:47:50 +03:00
{{end}}
{{end}}
2018-01-05 13:53:31 +03:00
{{if $ frontend . RateLimit }}
2018-02-23 13:38:02 +03:00
[frontends."{{ $ frontendName }}".rateLimit]
2017-12-22 00:07:37 +03:00
extractorFunc = "{{ $ frontend . RateLimit . ExtractorFunc }}"
2018-02-23 13:38:02 +03:00
[frontends."{{ $ frontendName }}".rateLimit.rateSet]
2018-01-05 13:53:31 +03:00
{{range $ limitName , $ limit := $ frontend . RateLimit . RateSet }}
2018-02-23 13:38:02 +03:00
[frontends."{{ $ frontendName }}".rateLimit.rateSet.{{ $ limitName }}]
2017-12-22 00:07:37 +03:00
period = "{{ $ limit . Period }}"
average = {{ $ limit . Average }}
burst = {{ $ limit . Burst }}
{{end}}
{{end}}
2018-01-02 16:49:11 +03:00
{{if $ frontend . Headers }}
2018-01-05 13:53:31 +03: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 }}
2018-03-02 16:24:03 +03:00
CustomBrowserXSSValue = "{{ $ frontend . Headers . CustomBrowserXSSValue }}"
2018-01-05 13:53:31 +03: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 18:14:19 +03:00
"{{.}}",
{{end}}]
{{end}}
2018-01-05 13:53:31 +03:00
{{if $ frontend . Headers . HostsProxyHeaders }}
HostsProxyHeaders = [{{range $ frontend . Headers . HostsProxyHeaders }}
2017-12-16 18:14:19 +03:00
"{{.}}",
{{end}}]
{{end}}
2018-01-05 13:53:31 +03:00
{{if $ frontend . Headers . CustomRequestHeaders }}
[frontends."{{ $ frontendName }}".headers.customRequestHeaders]
{{range $k, $v := $ frontend . Headers . CustomRequestHeaders }}
{{ $k }} = "{{ $v }}"
2017-12-16 18:14:19 +03:00
{{end}}
2017-11-28 15:36:03 +03:00
{{end}}
2018-01-05 13:53:31 +03:00
{{if $ frontend . Headers . CustomResponseHeaders }}
[frontends."{{ $ frontendName }}".headers.customResponseHeaders]
{{range $k, $v := $ frontend . Headers . CustomResponseHeaders }}
{{ $k }} = "{{ $v }}"
2017-12-16 18:14:19 +03:00
{{end}}
2017-11-28 15:36:03 +03:00
{{end}}
2018-01-05 13:53:31 +03:00
{{if $ frontend . Headers . SSLProxyHeaders }}
[frontends."{{ $ frontendName }}".headers.SSLProxyHeaders]
{{range $k, $v := $ frontend . Headers . SSLProxyHeaders }}
{{ $k }} = "{{ $v }}"
2017-12-16 18:14:19 +03:00
{{end}}
2017-11-28 15:36:03 +03:00
{{end}}
2017-12-16 18:14:19 +03:00
{{end}}
2018-01-05 13:53:31 +03:00
{{range $ routeName , $ route := $ frontend . Routes }}
[frontends."{{ $ frontendName }}".routes."{{ $ routeName }}"]
rule = "{{ $ route . Rule }}"
2016-02-08 23:57:32 +03:00
{{end}}
2017-12-16 18:14:19 +03:00
2018-01-08 02:36:03 +03:00
{{end}}
2017-12-16 18:14:19 +03:00
{{range $ tls := .TLS }}
2018-01-24 13:57:06 +03:00
[[tls]]
2017-12-16 18:14:19 +03:00
entryPoints = [{{range $ tls . EntryPoints }}
2018-01-08 02:36:03 +03:00
"{{.}}",
2017-12-16 18:14:19 +03:00
{{end}}]
2018-01-24 13:57:06 +03:00
[tls.certificate]
2017-12-16 18:14:19 +03:00
certFile = """{{ $ tls . Certificate . CertFile }}"""
keyFile = """{{ $ tls . Certificate . KeyFile }}"""
2018-01-08 02:36:03 +03:00
{{end}}