Add the possibility to define the VIRTUAL_HOST_VARNAME in order to be able to create multiple nginx-proxy instances.

This commit is contained in:
Julien PILLON 2020-09-14 20:23:12 +02:00
parent b0c6c9f67e
commit 1030f773f9

View file

@ -168,7 +168,10 @@ server {
}
{{ end }}
{{ range $host, $containers := groupByMulti $ "Env.VIRTUAL_HOST" "," }}
{{/* Get the VIRTUAL_HOST_VARNAME for filtering */}}
{{ $virtual_host_varname := (or ($.Env.VIRTUAL_HOST_VARNAME) "VIRTUAL_HOST") }}
{{ range $host, $containers := groupByMulti $ (print "Env." $virtual_host_varname) "," }}
{{ $host := trim $host }}
{{ $is_regexp := hasPrefix "~" $host }}