Stop marking 127.0.0.1 as upstream and as down

This patch fixes a critical condition in which the whole LB is down.

    [emerg] 28#28: invalid number of arguments in "upstream" directive

And:

    Generated '/etc/nginx/conf.d/default.conf' from 12 containers
    Running 'nginx -s reload'
    Error running notify command: nginx -s reload, exit status 1
    Received event start for container 5c6cb0bf8e05

What is 127.0.0.1 ? Isn't it the nginx-proxy container ?
How can it be an upstream at all ?

Related: #1132 #1106
Comments (not OP) of: #375
Maybe: #1144
This commit is contained in:
jpic 2019-07-08 21:19:49 +02:00 committed by jpic
parent 8c590fc68f
commit 95837c8fff

View file

@ -15,8 +15,6 @@
# {{ .Container.Name }}
{{ if .Network.IP }}
server {{ .Network.IP }} down;
{{ else }}
server 127.0.0.1 down;
{{ end }}
{{ end }}
@ -142,9 +140,6 @@ upstream {{ $upstream_name }} {
{{ $address := where $container.Addresses "Port" $port | first }}
{{ template "upstream" (dict "Container" $container "Address" $address "Network" $containerNetwork) }}
{{ end }}
{{ else }}
# Cannot connect to network of this container
server 127.0.0.1 down;
{{ end }}
{{ end }}
{{ end }}