2017-12-16 16:14:19 +01:00
[backends]
2018-01-05 11:53:31 +01:00
{{range $ backendName , $ backend := .Backends }}
2017-12-16 16:14:19 +01:00
2018-01-05 11:53:31 +01:00
[backends."{{ $ backendName }}"]
2017-12-16 16:14:19 +01:00
2018-01-05 11:53:31 +01:00
{{if $ backend . CircuitBreaker }}
2018-03-07 22:10:04 +01:00
[backends."{{ $ backendName }}".circuitBreaker]
2018-01-05 11:53:31 +01:00
expression = "{{ $ backend . CircuitBreaker . Expression }}"
2017-02-03 11:47:48 -05:00
{{end}}
2017-12-16 16:14:19 +01:00
2018-10-29 18:42:03 +01:00
{{if $ backend . ResponseForwarding }}
[backends."{{ $ backendName }}".responseForwarding]
flushInterval = "{{ $ backend . responseForwarding . FlushInterval }}"
{{end}}
2018-01-05 11:53:31 +01:00
[backends."{{ $ backendName }}".loadBalancer]
method = "{{ $ backend . LoadBalancer . Method }}"
{{if $ backend . LoadBalancer . Stickiness }}
[backends."{{ $ backendName }}".loadBalancer.stickiness]
cookieName = "{{ $ backend . LoadBalancer . Stickiness . CookieName }}"
2017-01-25 08:11:00 -05:00
{{end}}
2018-01-31 15:32:04 +01:00
2018-01-05 11:53:31 +01:00
{{if $ backend . MaxConn }}
2018-03-07 22:10:04 +01:00
[backends."{{ $ backendName }}".maxConn]
2017-12-21 22:44:06 +01:00
amount = {{ $ backend . MaxConn . Amount }}
extractorFunc = "{{ $ backend . MaxConn . ExtractorFunc }}"
{{end}}
2018-01-31 15:32:04 +01: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 11:53:31 +01:00
{{range $ serverName , $ server := $ backend . Servers }}
[backends."{{ $ backendName }}".servers."{{ $ serverName }}"]
url = "{{ $ server . URL }}"
weight = {{ $ server . Weight }}
2016-02-08 21:57:32 +01:00
{{end}}
2017-12-16 16:14:19 +01:00
2016-02-08 21:57:32 +01:00
{{end}}
2017-12-16 16:14:19 +01:00
[frontends]
2018-01-05 11:53:31 +01:00
{{range $ frontendName , $ frontend := .Frontends }}
2017-12-16 16:14:19 +01:00
2018-01-05 11:53:31 +01:00
[frontends."{{ $ frontendName }}"]
backend = "{{ $ frontend . Backend }}"
priority = {{ $ frontend . Priority }}
passHostHeader = {{ $ frontend . PassHostHeader }}
passTLSCert = {{ $ frontend . PassTLSCert }}
2017-12-16 16:14:19 +01:00
2018-01-05 11:53:31 +01:00
entryPoints = [{{range $ frontend . EntryPoints }}
2017-04-23 16:17:20 +02:00
"{{.}}",
2017-12-16 16:14:19 +01:00
{{end}}]
2017-12-15 11:48:03 +01:00
2018-07-02 11:52:04 +02:00
{{if $ frontend . Auth }}
[frontends."{{ $ frontendName }}".auth]
headerField = "X-WebAuth-User"
{{if $ frontend . Auth . Basic }}
[frontends."{{ $ frontendName }}".auth.basic]
2018-07-16 13:52:03 +02:00
removeHeader = {{ $ frontend . Auth . Basic . RemoveHeader }}
2018-07-02 11:52:04 +02:00
users = [{{range $ frontend . Auth . Basic . Users }}
"{{.}}",
{{end}}]
{{end}}
{{if $ frontend . Auth . Digest }}
[frontends."{{ $ frontendName }}".auth.digest]
2018-07-16 13:52:03 +02:00
removeHeader = {{ $ frontend . Auth . Digest . RemoveHeader }}
2018-07-02 11:52:04 +02:00
users = [{{range $ frontend . Auth . Digest . Users }}
"{{.}}",
{{end}}]
{{end}}
{{if $ frontend . Auth . Forward }}
[frontends."{{ $ frontendName }}".auth.forward]
address = "{{ $ frontend . Auth . Forward . Address }}"
authResponseHeaders = [{{range $ frontend . Auth . Forward . AuthResponseHeaders }}
"{{.}}",
{{end}}]
trustForwardHeader = {{ $ frontend . Auth . Forward . TrustForwardHeader }}
{{if $ frontend . Auth . Forward . TLS }}
[frontends."{{ $ frontendName }}".auth.forward.tls]
2018-08-21 17:12:03 +02:00
cert = """{{ $ frontend . Auth . Forward . TLS . Cert }}"""
key = """{{ $ frontend . Auth . Forward . TLS . Key }}"""
2018-07-02 11:52:04 +02:00
insecureSkipVerify = {{ $ frontend . Auth . Forward . TLS . InsecureSkipVerify }}
{{end}}
{{end}}
{{end}}
2018-03-23 17:40:04 +01:00
{{if $ frontend . WhiteList }}
[frontends."{{ $ frontendName }}".whiteList]
2018-08-24 16:20:03 +02:00
sourceRange = [{{range $ frontend . Whitelist . SourceRange }}
2018-03-23 17:40:04 +01:00
"{{.}}",
{{end}}]
2018-08-24 16:20:03 +02:00
{{if $ frontend . Whitelist . IPStrategy }}
[frontends."{{ $ frontendName }}".whiteList.IPStrategy]
depth = {{ $ frontend . Whitelist . IPStrategy . Depth }}
excludedIPs = [{{range $ frontend . Whitelist . IPStrategy . ExcludedIPs }}
"{{.}}",
{{end}}]
{{end}}
2018-03-23 17:40:04 +01:00
{{end}}
2017-12-16 16:14:19 +01:00
2018-01-05 11:53:31 +01:00
{{if $ frontend . Redirect }}
[frontends."{{ $ frontendName }}".redirect]
entryPoint = "{{ $ frontend . Redirect . EntryPoint }}"
regex = "{{ $ frontend . Redirect . Regex }}"
replacement = "{{ $ frontend . Redirect . Replacement }}"
2018-05-16 02:46:03 -06:00
permanent = {{ $ frontend . Redirect . Permanent }}
2017-12-16 16:14:19 +01:00
{{end}}
2017-12-15 11:48:03 +01:00
2018-01-05 11:53:31 +01:00
{{if $ frontend . Errors }}
2018-02-23 11:38:02 +01:00
[frontends."{{ $ frontendName }}".errors]
2018-01-05 11:53:31 +01:00
{{range $ pageName , $ page := $ frontend . Errors }}
2018-03-07 22:10:04 +01:00
[frontends."{{ $ frontendName }}".errors."{{ $ pageName }}"]
2018-01-05 11:53:31 +01:00
status = [{{range $ page . Status }}
2017-12-21 17:47:50 +01:00
"{{.}}",
{{end}}]
2018-01-05 11:53:31 +01:00
backend = "{{ $ page . Backend }}"
query = "{{ $ page . Query }}"
2017-12-21 17:47:50 +01:00
{{end}}
{{end}}
2018-01-05 11:53:31 +01:00
{{if $ frontend . RateLimit }}
2018-02-23 11:38:02 +01:00
[frontends."{{ $ frontendName }}".rateLimit]
2017-12-21 22:07:37 +01:00
extractorFunc = "{{ $ frontend . RateLimit . ExtractorFunc }}"
2018-02-23 11:38:02 +01:00
[frontends."{{ $ frontendName }}".rateLimit.rateSet]
2018-01-05 11:53:31 +01:00
{{range $ limitName , $ limit := $ frontend . RateLimit . RateSet }}
2018-03-07 22:10:04 +01:00
[frontends."{{ $ frontendName }}".rateLimit.rateSet."{{ $ limitName }}"]
2017-12-21 22:07:37 +01:00
period = "{{ $ limit . Period }}"
average = {{ $ limit . Average }}
burst = {{ $ limit . Burst }}
{{end}}
{{end}}
2018-10-29 16:02:06 +01:00
{{if $ frontend . PassTLSClientCert }}
[frontends."{{ $ frontendName }}".passTLSClientCert]
pem = {{ $ frontend . PassTLSClientCert . PEM }}
{{ $ infos := $ frontend . PassTLSClientCert . Infos }}
{{if $ infos }}
[frontends."{{ $ frontendName }}".passTLSClientCert.infos]
notAfter = {{ $ infos . NotAfter }}
notBefore = {{ $ infos . NotBefore }}
sans = {{ $ infos . Sans }}
{{ $ subject := $ infos . Subject }}
{{if $ subject }}
[frontends."{{ $ frontendName }}".passTLSClientCert.infos.subject]
country = {{ $ subject . Country }}
province = {{ $ subject . Province }}
locality = {{ $ subject . Locality }}
organization = {{ $ subject . Organization }}
commonName = {{ $ subject . CommonName }}
serialNumber = {{ $ subject . SerialNumber }}
2019-01-08 09:46:04 +01:00
domainComponent = {{ $ subject . DomainComponent }}
{{end}}
{{ $ issuer := $ infos . Subject }}
{{if $ issuer }}
[frontends."{{ $ frontendName }}".passTLSClientCert.infos.issuer]
country = {{ $ issuer . Country }}
province = {{ $ issuer . Province }}
locality = {{ $ issuer . Locality }}
organization = {{ $ issuer . Organization }}
commonName = {{ $ issuer . CommonName }}
serialNumber = {{ $ issuer . SerialNumber }}
domainComponent = {{ $ issuer . DomainComponent }}
2018-10-29 16:02:06 +01:00
{{end}}
{{end}}
{{end}}
2018-01-02 14:49:11 +01:00
{{if $ frontend . Headers }}
2018-01-05 11:53:31 +01:00
[frontends."{{ $ frontendName }}".headers]
SSLRedirect = {{ $ frontend . Headers . SSLRedirect }}
SSLTemporaryRedirect = {{ $ frontend . Headers . SSLTemporaryRedirect }}
SSLHost = "{{ $ frontend . Headers . SSLHost }}"
2018-05-14 11:44:03 +02:00
SSLForceHost = {{ $ frontend . Headers . SSLForceHost }}
2018-01-05 11:53:31 +01: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 14:24:03 +01:00
CustomBrowserXSSValue = "{{ $ frontend . Headers . CustomBrowserXSSValue }}"
2018-01-05 11:53:31 +01: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 16:14:19 +01:00
"{{.}}",
{{end}}]
{{end}}
2018-01-05 11:53:31 +01:00
{{if $ frontend . Headers . HostsProxyHeaders }}
HostsProxyHeaders = [{{range $ frontend . Headers . HostsProxyHeaders }}
2017-12-16 16:14:19 +01:00
"{{.}}",
{{end}}]
{{end}}
2018-01-05 11:53:31 +01:00
{{if $ frontend . Headers . CustomRequestHeaders }}
[frontends."{{ $ frontendName }}".headers.customRequestHeaders]
{{range $k, $v := $ frontend . Headers . CustomRequestHeaders }}
{{ $k }} = "{{ $v }}"
2017-12-16 16:14:19 +01:00
{{end}}
2017-11-28 06:36:03 -06:00
{{end}}
2018-01-05 11:53:31 +01:00
{{if $ frontend . Headers . CustomResponseHeaders }}
[frontends."{{ $ frontendName }}".headers.customResponseHeaders]
{{range $k, $v := $ frontend . Headers . CustomResponseHeaders }}
{{ $k }} = "{{ $v }}"
2017-12-16 16:14:19 +01:00
{{end}}
2017-11-28 06:36:03 -06:00
{{end}}
2018-01-05 11:53:31 +01:00
{{if $ frontend . Headers . SSLProxyHeaders }}
[frontends."{{ $ frontendName }}".headers.SSLProxyHeaders]
{{range $k, $v := $ frontend . Headers . SSLProxyHeaders }}
{{ $k }} = "{{ $v }}"
2017-12-16 16:14:19 +01:00
{{end}}
2017-11-28 06:36:03 -06:00
{{end}}
2017-12-16 16:14:19 +01:00
{{end}}
2018-01-05 11:53:31 +01:00
{{range $ routeName , $ route := $ frontend . Routes }}
[frontends."{{ $ frontendName }}".routes."{{ $ routeName }}"]
rule = "{{ $ route . Rule }}"
2016-02-08 21:57:32 +01:00
{{end}}
2017-12-16 16:14:19 +01:00
2018-01-08 00:36:03 +01:00
{{end}}
2017-12-16 16:14:19 +01:00
{{range $ tls := .TLS }}
2018-01-24 11:57:06 +01:00
[[tls]]
2017-12-16 16:14:19 +01:00
entryPoints = [{{range $ tls . EntryPoints }}
2018-01-08 00:36:03 +01:00
"{{.}}",
2017-12-16 16:14:19 +01:00
{{end}}]
2018-01-24 11:57:06 +01:00
[tls.certificate]
2017-12-16 16:14:19 +01:00
certFile = """{{ $ tls . Certificate . CertFile }}"""
keyFile = """{{ $ tls . Certificate . KeyFile }}"""
2018-01-08 00:36:03 +01:00
{{end}}