diff --git a/nginx.tmpl b/nginx.tmpl index 3eb0298..a5b1d32 100644 --- a/nginx.tmpl +++ b/nginx.tmpl @@ -99,7 +99,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 }}