diff --git a/nginx.tmpl b/nginx.tmpl index e7d77c9..02e3853 100644 --- a/nginx.tmpl +++ b/nginx.tmpl @@ -259,7 +259,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 }}