diff --git a/nginx.tmpl b/nginx.tmpl index a6a45e6..8bef446 100644 --- a/nginx.tmpl +++ b/nginx.tmpl @@ -92,7 +92,8 @@ server { {{ end }} {{ range $host, $containers := groupByMulti $ "Env.VIRTUAL_HOST" "," }} -{{ $upstream_name := sha1 $host }} +{{ $is_regexp := hasPrefix "~" $host }} +{{ $upstream_name := when $is_regexp (sha1 $host) $host }} # {{ $host }} upstream {{ $upstream_name }} { {{ range $container := $containers }}