Skip to content

Commit

Permalink
do not create an empty upstream entry for a container from an invisib…
Browse files Browse the repository at this point in the history
…le Docker network
  • Loading branch information
Harald Wellmann committed Mar 22, 2018
1 parent 000a447 commit b61c841
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions nginx.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,9 @@ 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 }}
Expand Down

0 comments on commit b61c841

Please sign in to comment.