1
0
mirror of https://github.com/nginx-proxy/nginx-proxy synced 2025-05-02 06:05:26 +02:00

Use 'or' function instead of replacing an already defined variable

This commit is contained in:
Niklas Keller 2015-10-10 12:58:18 +02:00
parent e583285351
commit cecac88a71

@ -74,10 +74,7 @@ server {
upstream {{ $host }} {
{{ range $container := $containers }}
{{ $weight := 1 }}
{{ if $container.Env.VIRTUAL_WEIGHT }}
{{ $weight := $container.Env.VIRTUAL_WEIGHT }}
{{end }}
{{ $weight := or ($container.Env.VIRTUAL_WEIGHT) "1" }}
{{ $addrLen := len $container.Addresses }}
{{/* If only 1 port exposed, use that */}}
{{ if eq $addrLen 1 }}