1
0
mirror of https://github.com/thib8956/nginx-proxy synced 2024-11-25 13:26:30 +00:00

regexp: use sha1 for upstream only if regexp is used

avoid confusions such as in #677
This commit is contained in:
Thomas LEVEIL 2017-01-14 11:40:33 +01:00
parent 2c5d4ee3a9
commit 3f6381d0fa

View File

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