|
@@ -23,16 +23,16 @@ frontend main
|
23
|
23
|
redirect scheme https code 301 if !{ ssl_fc }
|
24
|
24
|
http-response set-header Strict-Transport-Security max-age=15768000
|
25
|
25
|
{{ range .Containers }}
|
26
|
|
- {{- if index .Labels "com.chameth.port" -}}
|
|
26
|
+ {{- if index .Labels "com.chameth.proxy" -}}
|
27
|
27
|
{{- if index .Labels "com.chameth.vhost" }}
|
28
|
28
|
use_backend {{ .Name }} if { hdr(host) -i {{ index .Labels "com.chameth.vhost" | split "," | join " || hdr(host) -i " }} }
|
29
|
29
|
{{- end -}}
|
30
|
30
|
{{- end -}}
|
31
|
31
|
{{ end }}
|
32
|
32
|
{{ range .Containers }}
|
33
|
|
- {{- if index .Labels "com.chameth.port" }}
|
|
33
|
+ {{- if index .Labels "com.chameth.proxy" }}
|
34
|
34
|
backend {{ .Name }}
|
35
|
35
|
mode http
|
36
|
|
- server server1 {{ .Name }}:{{ index .Labels "com.chameth.port" }} check resolvers docker_resolver
|
|
36
|
+ server server1 {{ .Name }}:{{ index .Labels "com.chameth.proxy" }} check resolvers docker_resolver
|
37
|
37
|
{{- end -}}
|
38
|
38
|
{{ end }}
|