Forráskód Böngészése

fix: do not discard containers without VIRTUAL_PATH

For containers grouped by identical VIRTUAL_HOST,
those with no VIRTUAL_PATH variable were silently discarded
when at least one container with VIRTUAL_PATH existed.
Nicolas Duchon 1 éve
szülő
commit
be7c4c8c85
1 módosított fájl, 1 hozzáadás és 4 törlés
  1. 1 4
      nginx.tmpl

+ 1 - 4
nginx.tmpl

@@ -526,10 +526,7 @@ proxy_set_header Proxy "";
     {{- $vhost_data := when (hasKey $globals.vhosts $hostname) (get $globals.vhosts $hostname) (dict) }}
     {{- $paths := coalesce $vhost_data.paths (dict) }}
 
-    {{- $tmp_paths := groupBy $containers "Env.VIRTUAL_PATH" }}
-    {{- if not (gt (len $tmp_paths) 0) }}
-        {{- $tmp_paths = dict "/" $containers }}
-    {{- end }}
+    {{- $tmp_paths := groupByWithDefault $containers "Env.VIRTUAL_PATH" "/" }}
 
     {{- range $path, $containers := $tmp_paths }}
         {{- $dest := or (first (groupByKeys $containers "Env.VIRTUAL_DEST")) "" }}