Skip to content

Commit

Permalink
Updated HAProxy configuration template to allow even more vhosts.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaytaylor committed Feb 9, 2018
1 parent ba99e0c commit 81b32ba
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/scripts.go
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,14 @@ frontend frontend
option forwardfor
option http-server-close
{{range $app := .Applications}}
{{if .Domains}}use_backend {{$app.Name}}{{if $app.Maintenance}}-maintenance{{end}} if { {{range .Domains}} hdr(host) -i {{.}} {{end}} }{{end}}
{{- range $i, $domain := .Domains }}
acl {{$i}}_{{$app.Name}} hdr(host) -i {{$domain}}
{{- end }}
{{end}}
{{range $app := .Applications}}
{{- range $i, $domain := .Domains }}
use_backend {{$app.Name}}{{if $app.Maintenance}}-maintenance{{end}} if {{$i}}_{{$app.Name}}
{{- end }}
{{end}}
{{if and .HaProxyStatsEnabled .HaProxyCredentials .LoadBalancers}}use_backend load_balancer if { {{range .LoadBalancers }} hdr(host) -i {{.}} {{end}} }{{end}}
Expand Down

0 comments on commit 81b32ba

Please sign in to comment.