From e583285351f70cf6311771b413c2a064ff3dfbd4 Mon Sep 17 00:00:00 2001 From: Niklas Keller Date: Sat, 10 Oct 2015 01:19:06 +0200 Subject: [PATCH] Fix weight visibility / scope --- nginx.tmpl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/nginx.tmpl b/nginx.tmpl index 13b8d99..389683c 100644 --- a/nginx.tmpl +++ b/nginx.tmpl @@ -74,10 +74,9 @@ server { upstream {{ $host }} { {{ range $container := $containers }} + {{ $weight := 1 }} {{ if $container.Env.VIRTUAL_WEIGHT }} {{ $weight := $container.Env.VIRTUAL_WEIGHT }} - {{ else }} - {{ $weight := 1 }} {{end }} {{ $addrLen := len $container.Addresses }} {{/* If only 1 port exposed, use that */}}