2016-04-12 10:49:37 +03:00
[backends]
2018-01-01 01:49:32 +03:00
{{range $ service := .Services}}
2018-01-10 18:20:10 +03:00
{{ $ backendName := getServiceBackendName $ service }}
2016-04-12 10:49:37 +03:00
2018-01-01 05:10:17 +03:00
{{ $ circuitBreaker := getCircuitBreaker $ service . Attributes }}
{{if $ circuitBreaker }}
2018-01-10 18:20:10 +03:00
[backends."backend-{{ $ backendName }}".circuitBreaker]
2018-01-01 05:10:17 +03:00
expression = "{{ $ circuitBreaker . Expression }}"
2016-04-12 10:49:37 +03:00
{{end}}
2018-01-01 05:10:17 +03:00
{{ $ loadBalancer := getLoadBalancer $ service . Attributes }}
{{if $ loadBalancer }}
2018-01-10 18:20:10 +03:00
[backends."backend-{{ $ backendName }}".loadBalancer]
2018-01-01 05:10:17 +03:00
method = "{{ $ loadBalancer . Method }}"
sticky = {{ $ loadBalancer . Sticky }}
{{if $ loadBalancer . Stickiness }}
2018-01-10 18:20:10 +03:00
[backends."backend-{{ $ backendName }}".loadBalancer.stickiness]
2018-01-01 05:10:17 +03:00
cookieName = "{{ $ loadBalancer . Stickiness . CookieName }}"
2017-10-10 12:10:02 +03:00
{{end}}
2018-01-01 05:10:17 +03:00
{{end}}
2016-08-25 06:46:47 +03:00
2018-01-01 05:10:17 +03:00
{{ $ maxConn := getMaxConn $ service . Attributes }}
{{if $ maxConn }}
2018-01-10 18:20:10 +03:00
[backends."backend-{{ $ backendName }}".maxConn]
2018-01-01 05:10:17 +03:00
extractorFunc = "{{ $ maxConn . ExtractorFunc }}"
amount = {{ $ maxConn . Amount }}
2016-08-25 06:46:47 +03:00
{{end}}
2018-01-01 05:49:06 +03:00
{{ $ healthCheck := getHealthCheck $ service . Attributes }}
{{if $ healthCheck }}
2018-03-08 00:10:04 +03:00
[backends."backend-{{ $ backendName }}".healthCheck]
2018-01-01 05:49:06 +03:00
path = "{{ $ healthCheck . Path }}"
port = {{ $ healthCheck . Port }}
interval = "{{ $ healthCheck . Interval }}"
{{end}}
2018-01-31 17:32:04 +03:00
{{ $ buffering := getBuffering $ service . Attributes }}
{{if $ buffering }}
2018-03-08 00:10:04 +03:00
[backends."backend-{{ $ backendName }}".buffering]
2018-01-31 17:32:04 +03:00
maxRequestBodyBytes = {{ $ buffering . MaxRequestBodyBytes }}
memRequestBodyBytes = {{ $ buffering . MemRequestBodyBytes }}
maxResponseBodyBytes = {{ $ buffering . MaxResponseBodyBytes }}
memResponseBodyBytes = {{ $ buffering . MemResponseBodyBytes }}
retryExpression = "{{ $ buffering . RetryExpression }}"
{{end}}
2018-01-01 01:49:32 +03:00
{{end}}
{{range $ index , $ node := .Nodes}}
2018-01-02 20:21:38 +03:00
[backends."backend-{{ getNodeBackendName $ node }}".servers."{{ getServerName $ node $ index }}"]
2018-01-01 05:10:17 +03:00
url = "{{ getProtocol $ node . Service . Tags }}://{{ getBackendAddress $ node }}:{{ $ node . Service . Port }}"
weight = {{ getWeight $ node . Service . Tags }}
2018-01-01 01:49:32 +03:00
2016-02-02 20:03:40 +03:00
{{end}}
2016-04-15 10:56:06 +03:00
[frontends]
2018-01-01 01:49:32 +03:00
{{range $ service := .Services}}
2018-01-01 05:10:17 +03:00
[frontends."frontend-{{ $ service . ServiceName }}"]
2018-01-02 20:21:38 +03:00
backend = "backend-{{ getServiceBackendName $ service }}"
2018-01-01 05:10:17 +03:00
priority = {{ getPriority $ service . Attributes }}
passHostHeader = {{ getPassHostHeader $ service . Attributes }}
2018-01-01 05:22:53 +03:00
passTLSCert = {{ getPassTLSCert $ service . Attributes }}
2018-01-01 01:49:32 +03:00
2018-01-01 05:10:17 +03:00
entryPoints = [{{range getFrontEndEntryPoints $ service . Attributes }}
2016-04-12 10:49:37 +03:00
"{{.}}",
2018-01-01 01:49:32 +03:00
{{end}}]
2018-01-01 05:10:17 +03:00
basicAuth = [{{range getBasicAuth $ service . Attributes }}
2018-01-01 01:49:32 +03:00
"{{.}}",
{{end}}]
2018-03-23 19:40:04 +03:00
{{ $ whitelist := getWhiteList $ service . Attributes }}
{{if $ whitelist }}
[frontends."frontend-{{ $ service . ServiceName }}".whiteList]
sourceRange = [{{range $ whitelist . SourceRange }}
"{{.}}",
{{end}}]
useXForwardedFor = {{ $ whitelist . UseXForwardedFor }}
{{end}}
2018-01-01 06:03:29 +03:00
{{ $ redirect := getRedirect $ service . Attributes }}
{{if $ redirect }}
[frontends."frontend-{{ $ service . ServiceName }}".redirect]
entryPoint = "{{ $ redirect . EntryPoint }}"
regex = "{{ $ redirect . Regex }}"
replacement = "{{ $ redirect . Replacement }}"
2018-01-31 21:10:04 +03:00
permanent = {{ $ redirect . Permanent }}
2018-01-01 06:03:29 +03:00
{{end}}
2018-01-10 18:20:10 +03:00
{{if hasErrorPages $ service . Attributes }}
2018-01-01 06:38:10 +03:00
[frontends."frontend-{{ $ service . ServiceName }}".errors]
2018-01-10 18:20:10 +03:00
{{range $ pageName , $ page := getErrorPages $ service . Attributes }}
2018-03-08 00:10:04 +03:00
[frontends."frontend-{{ $ service . ServiceName }}".errors."{{ $ pageName }}"]
2018-01-01 06:38:10 +03:00
status = [{{range $ page . Status }}
2018-01-10 18:20:10 +03:00
"{{.}}",
{{end}}]
2018-01-01 06:38:10 +03:00
backend = "{{ $ page . Backend }}"
query = "{{ $ page . Query }}"
{{end}}
{{end}}
2018-01-10 18:20:10 +03:00
{{if hasRateLimit $ service . Attributes }}
2018-01-01 06:38:10 +03:00
{{ $ rateLimit := getRateLimit $ service . Attributes }}
[frontends."frontend-{{ $ service . ServiceName }}".rateLimit]
extractorFunc = "{{ $ rateLimit . ExtractorFunc }}"
[frontends."frontend-{{ $ service . ServiceName }}".rateLimit.rateSet]
2018-01-10 18:20:10 +03:00
{{range $ limitName , $ limit := $ rateLimit . RateSet }}
2018-03-08 00:10:04 +03:00
[frontends."frontend-{{ $ service . ServiceName }}".rateLimit.rateSet."{{ $ limitName }}"]
2018-01-01 06:38:10 +03:00
period = "{{ $ limit . Period }}"
average = {{ $ limit . Average }}
burst = {{ $ limit . Burst }}
{{end}}
{{end}}
2018-01-02 20:32:53 +03:00
{{ $ headers := getHeaders $ service . Attributes }}
2018-01-10 18:20:10 +03:00
{{if $ headers }}
2018-01-02 20:32:53 +03:00
[frontends."frontend-{{ $ service . ServiceName }}".headers]
SSLRedirect = {{ $ headers . SSLRedirect }}
SSLTemporaryRedirect = {{ $ headers . SSLTemporaryRedirect }}
SSLHost = "{{ $ headers . SSLHost }}"
STSSeconds = {{ $ headers . STSSeconds }}
STSIncludeSubdomains = {{ $ headers . STSIncludeSubdomains }}
STSPreload = {{ $ headers . STSPreload }}
ForceSTSHeader = {{ $ headers . ForceSTSHeader }}
FrameDeny = {{ $ headers . FrameDeny }}
CustomFrameOptionsValue = "{{ $ headers . CustomFrameOptionsValue }}"
ContentTypeNosniff = {{ $ headers . ContentTypeNosniff }}
BrowserXSSFilter = {{ $ headers . BrowserXSSFilter }}
2018-03-02 16:24:03 +03:00
CustomBrowserXSSValue = "{{ $ headers . CustomBrowserXSSValue }}"
2018-01-02 20:32:53 +03:00
ContentSecurityPolicy = "{{ $ headers . ContentSecurityPolicy }}"
PublicKey = "{{ $ headers . PublicKey }}"
ReferrerPolicy = "{{ $ headers . ReferrerPolicy }}"
IsDevelopment = {{ $ headers . IsDevelopment }}
2018-01-10 18:20:10 +03:00
{{if $ headers . AllowedHosts }}
AllowedHosts = [{{range $ headers . AllowedHosts }}
2018-01-02 20:32:53 +03:00
"{{.}}",
{{end}}]
{{end}}
2018-01-10 18:20:10 +03:00
{{if $ headers . HostsProxyHeaders }}
HostsProxyHeaders = [{{range $ headers . HostsProxyHeaders }}
2018-01-02 20:32:53 +03:00
"{{.}}",
{{end}}]
{{end}}
2018-01-10 18:20:10 +03:00
{{if $ headers . CustomRequestHeaders }}
2018-01-02 20:32:53 +03:00
[frontends."frontend-{{ $ service . ServiceName }}".headers.customRequestHeaders]
2018-01-10 18:20:10 +03:00
{{range $k, $v := $ headers . CustomRequestHeaders }}
2018-01-02 20:32:53 +03:00
{{ $k}} = "{{ $v}}"
{{end}}
{{end}}
2018-01-10 18:20:10 +03:00
{{if $ headers . CustomResponseHeaders }}
2018-01-02 20:32:53 +03:00
[frontends."frontend-{{ $ service . ServiceName }}".headers.customResponseHeaders]
2018-01-10 18:20:10 +03:00
{{range $k, $v := $ headers . CustomResponseHeaders }}
2018-01-02 20:32:53 +03:00
{{ $k}} = "{{ $v}}"
{{end}}
{{end}}
2018-01-10 18:20:10 +03:00
{{if $ headers . SSLProxyHeaders }}
2018-01-02 20:32:53 +03:00
[frontends."frontend-{{ $ service . ServiceName }}".headers.SSLProxyHeaders]
{{range $k, $v := $ headers . SSLProxyHeaders }}
{{ $k}} = "{{ $v}}"
{{end}}
{{end}}
{{end}}
2018-01-02 20:21:38 +03:00
[frontends."frontend-{{ $ service . ServiceName }}".routes."route-host-{{ $ service . ServiceName }}"]
2018-01-01 05:10:17 +03:00
rule = "{{ getFrontendRule $ service }}"
2018-01-01 01:49:32 +03:00
2016-02-02 20:03:40 +03:00
{{end}}