diff --git a/internal/configs/version1/nginx.ingress.tmpl b/internal/configs/version1/nginx.ingress.tmpl index 0cfa115b7e..77772c06f2 100644 --- a/internal/configs/version1/nginx.ingress.tmpl +++ b/internal/configs/version1/nginx.ingress.tmpl @@ -2,8 +2,8 @@ {{range $upstream := .Upstreams}} upstream {{$upstream.Name}} { {{if ne $upstream.UpstreamZoneSize "0"}}zone {{$upstream.Name}} {{$upstream.UpstreamZoneSize}};{{end}} -{{if $upstream.LBMethod }}{{$upstream.LBMethod}};{{end}} -{{range $server := $upstream.UpstreamServers}} + {{if $upstream.LBMethod }}{{$upstream.LBMethod}};{{end}} + {{range $server := $upstream.UpstreamServers}} server {{$server.Address}} max_fails={{$server.MaxFails}} fail_timeout={{$server.FailTimeout}} max_conns={{$server.MaxConns}};{{end}} {{if $.Keepalive}}keepalive {{$.Keepalive}};{{end}} }{{end}}