mirror of
https://github.com/thib8956/nginx-proxy
synced 2025-06-30 22:05:46 +00:00
feat: print warning on unparsable VIRTUAL_HOST_MULTIPORTS
This commit is contained in:
14
nginx.tmpl
14
nginx.tmpl
@ -459,7 +459,19 @@ proxy_set_header Proxy "";
|
||||
|
||||
{{- /* Precompute and store some information about vhost that use VIRTUAL_HOST_MULTIPORTS. */}}
|
||||
{{- range $vhosts_yaml, $containers := groupBy $globals.containers "Env.VIRTUAL_HOST_MULTIPORTS" }}
|
||||
{{- range $hostname, $vhost := (fromYaml $vhosts_yaml) }}
|
||||
{{- /* Print a warning in the config if VIRTUAL_HOST_MULTIPORTS can't be parsed. */}}
|
||||
{{- $parsedVhosts := fromYaml $vhosts_yaml }}
|
||||
{{- if (empty $parsedVhosts) }}
|
||||
{{- $containerNames := list }}
|
||||
{{- range $container := $containers }}
|
||||
{{- $containerNames = append $containerNames $container.Name }}
|
||||
{{- end }}
|
||||
# /!\ WARNING: the VIRTUAL_HOST_MULTIPORTS environment variable used for {{ len $containerNames | plural "this container" "those containers" }} is not a valid YAML string:
|
||||
# {{ $containerNames | join ", " }}
|
||||
{{- continue }}
|
||||
{{- end }}
|
||||
|
||||
{{- range $hostname, $vhost := $parsedVhosts }}
|
||||
{{- $vhost_data := when (hasKey $globals.vhosts $hostname) (get $globals.vhosts $hostname) (dict) }}
|
||||
{{- $paths := coalesce $vhost_data.paths (dict) }}
|
||||
|
||||
|
Reference in New Issue
Block a user