From aad20386b3f9083b8a68b5aa7e697d5697b7b593 Mon Sep 17 00:00:00 2001 From: Donal Byrne Date: Wed, 3 Dec 2014 20:50:10 +0100 Subject: [PATCH] Didn't handle case where no colon was given in VIRTUAL_HOST. Now correctly only grabs the port if there was one set. Before had gotten the host by mistake if no colon --- nginx.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nginx.tmpl b/nginx.tmpl index 0312ecf..f8a47ee 100644 --- a/nginx.tmpl +++ b/nginx.tmpl @@ -49,7 +49,7 @@ upstream {{ $host }} { server {{ $address.IP }}:{{ $address.Port }}; {{ end }} {{/* If more than one port exposed, use the one matching after the colon in VIRTUAL_HOST env var */}} - {{ else if $port }} + {{ else if (and ($port ) (ne $port $host) ) }} {{ range $address := .Addresses }} {{ if eq $address.Port $port }} # {{$container.Name}}