소스 검색

Merge pull request #1106 from hwellmann/master

do not create an empty upstream entry for invisible containers
Jason Wilder 7 년 전
부모
커밋
6290f38069
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      nginx.tmpl

+ 3 - 0
nginx.tmpl

@@ -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 }}