瀏覽代碼

fix: always use sha1 of hostname as upstream name

Nicolas Duchon 3 年之前
父節點
當前提交
89d37882b6
共有 1 個文件被更改,包括 1 次插入2 次删除
  1. 1 2
      nginx.tmpl

+ 1 - 2
nginx.tmpl

@@ -153,8 +153,7 @@ server {
 {{ range $host, $containers := groupByMulti $ "Env.VIRTUAL_HOST" "," }}
 
 {{ $host := trim $host }}
-{{ $is_regexp := hasPrefix "~" $host }}
-{{ $upstream_name := (print (when $is_regexp (sha1 $host) $host) "-upstream") }}
+{{ $upstream_name := sha1 $host }}
 
 # {{ $host }}
 upstream {{ $upstream_name }} {