diff --git a/nginx.tmpl b/nginx.tmpl index 66f346c..eb2e8ee 100644 --- a/nginx.tmpl +++ b/nginx.tmpl @@ -9,16 +9,16 @@ {{/* If we got the containers from swarm and this container's port is published to host, use host IP:PORT */}} {{ if and .Container.Node.ID .Address.HostPort }} # {{ .Container.Node.Name }}/{{ .Container.Name }} - server {{ .Container.Node.Address.IP }}:{{ .Address.HostPort }}; + server {{ .Container.Node.Address.IP }}:{{ .Address.HostPort }} max_fails=0; {{/* If there is no swarm node or the port is not published on host, use container's IP:PORT */}} {{ else if .Network }} # {{ .Container.Name }} - server {{ .Network.IP }}:{{ .Address.Port }}; + server {{ .Network.IP }}:{{ .Address.Port }} max_fails=0; {{ end }} {{ else if .Network }} # {{ .Container.Name }} {{ if .Network.IP }} - server {{ .Network.IP }}:{{ .VirtualPort }}; + server {{ .Network.IP }}:{{ .VirtualPort }} max_fails=0; {{ else }} # /!\ No IP for this network! {{ end }}