From 1030f773f97eb25188a0250296997767c156aec2 Mon Sep 17 00:00:00 2001 From: Julien PILLON Date: Mon, 14 Sep 2020 20:23:12 +0200 Subject: [PATCH] Add the possibility to define the VIRTUAL_HOST_VARNAME in order to be able to create multiple nginx-proxy instances. --- nginx.tmpl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nginx.tmpl b/nginx.tmpl index 07e2b50..4125cbe 100644 --- a/nginx.tmpl +++ b/nginx.tmpl @@ -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 }}