2
0
Эх сурвалжийг харах

Merge pull request #679 from thomasleveil/issue-677

regexp: use sha1 for upstream only if regexp is used
Jason Wilder 8 жил өмнө
parent
commit
985c46d8b5
1 өөрчлөгдсөн 2 нэмэгдсэн , 1 устгасан
  1. 2 1
      nginx.tmpl

+ 2 - 1
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 }}