This commit is contained in:
parent
d010200de7
commit
f797d909cf
1 changed files with 5 additions and 3 deletions
|
@ -12,8 +12,6 @@ export HAPROXY_TEMPLATE="./haproxy.tmpl"
|
|||
# HaProxy Template
|
||||
|
||||
```
|
||||
{{- range .backends }}
|
||||
|
||||
backend {{ .Name }}
|
||||
mode {{ .Mode }}
|
||||
balance {{ .Balance }}
|
||||
|
@ -21,12 +19,16 @@ backend {{ .Name }}
|
|||
cookie {{ .CookieName }} {{ .CookieFlags }}
|
||||
{{- end }}
|
||||
|
||||
{{- if .HealthCheck }}
|
||||
option httpchk GET {{ .HealthCheck }}
|
||||
http-check expect status 200
|
||||
{{- end }}
|
||||
|
||||
{{- $backend := . }}
|
||||
{{- range .Servers }}
|
||||
server {{ .Name }} {{ .Address }}:{{ .Port }}{{ if $backend.HealthCheck }} check{{ end }}{{ if $backend.CookieName }} cookie {{ .Cookie }}{{ end }}{{ if $backend.ServerOptions }} {{ $backend.ServerOptions }}{{ end }}
|
||||
{{- end }}
|
||||
|
||||
{{- end }}
|
||||
|
||||
```
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue