From 09053bf1fd6041f425aae6ccb3cbb1a0cc586644 Mon Sep 17 00:00:00 2001 From: alesandar Date: Thu, 29 Jul 2021 19:05:11 +0300 Subject: [PATCH] fix: declare postgres upstream max_fails/fail_timeout directives --- nginx.tmpl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nginx.tmpl b/nginx.tmpl index 7c36e70..bd02c4e 100644 --- a/nginx.tmpl +++ b/nginx.tmpl @@ -188,7 +188,11 @@ upstream {{ $upstream_name }} { {{ else if $containerNetwork }} {{ $server_found = "true" }} # {{ $container.Name }} + {{ if eq $address.Port "5432"}} + server {{ $containerNetwork.IP }}:{{ $address.Port }} max_fails=1 fail_timeout=100000000000s; + {{ else }} server {{ $containerNetwork.IP }}:{{ $address.Port }}; + {{ end }} {{ end }} {{ else if $containerNetwork }} # {{ $container.Name }}