From 860c7b533b8917d726cf38b2b87a7d0399053cb2 Mon Sep 17 00:00:00 2001 From: SilverFire - Dmitry Naumenko Date: Wed, 3 May 2017 12:05:14 +0200 Subject: [PATCH] Prevent error `no servers are inside upstream` --- nginx.tmpl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nginx.tmpl b/nginx.tmpl index a5b1d32..97041ad 100644 --- a/nginx.tmpl +++ b/nginx.tmpl @@ -109,7 +109,7 @@ upstream {{ $upstream_name }} { {{ range $knownNetwork := $CurrentContainer.Networks }} {{ range $containerNetwork := $container.Networks }} {{ if eq $knownNetwork.Name $containerNetwork.Name }} - ## Can be connect with "{{ $containerNetwork.Name }}" network + ## Can be connected with "{{ $containerNetwork.Name }}" network {{/* If only 1 port exposed, use that */}} {{ if eq $addrLen 1 }} @@ -123,6 +123,7 @@ upstream {{ $upstream_name }} { {{ end }} {{ end }} {{ end }} + server localhost down; {{ end }} {{ end }} }