fix: always use sha1 of hostname as upstream name
This commit is contained in:
parent
ba86bc04f6
commit
89d37882b6
1 changed files with 1 additions and 2 deletions
|
@ -153,8 +153,7 @@ server {
|
||||||
{{ range $host, $containers := groupByMulti $ "Env.VIRTUAL_HOST" "," }}
|
{{ range $host, $containers := groupByMulti $ "Env.VIRTUAL_HOST" "," }}
|
||||||
|
|
||||||
{{ $host := trim $host }}
|
{{ $host := trim $host }}
|
||||||
{{ $is_regexp := hasPrefix "~" $host }}
|
{{ $upstream_name := sha1 $host }}
|
||||||
{{ $upstream_name := (print (when $is_regexp (sha1 $host) $host) "-upstream") }}
|
|
||||||
|
|
||||||
# {{ $host }}
|
# {{ $host }}
|
||||||
upstream {{ $upstream_name }} {
|
upstream {{ $upstream_name }} {
|
||||||
|
|
Loading…
Reference in a new issue