From 3412b6ba2fe891e6b0bb2d9b058012a55634e224 Mon Sep 17 00:00:00 2001 From: qiand4 Date: Fri, 18 Aug 2017 17:38:53 +0800 Subject: [PATCH] Fix sticky upstream not used when enable rewrite --- controllers/nginx/pkg/template/template.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/controllers/nginx/pkg/template/template.go b/controllers/nginx/pkg/template/template.go index 5fe735723..4e25d044c 100644 --- a/controllers/nginx/pkg/template/template.go +++ b/controllers/nginx/pkg/template/template.go @@ -312,13 +312,13 @@ func buildProxyPass(host string, b interface{}, loc interface{}) string { rewrite %s(.*) /$1 break; rewrite %s / break; proxy_pass %s://%s; - %v`, path, location.Path, proto, location.Backend, abu) + %v`, path, location.Path, proto, upstreamName, abu) } return fmt.Sprintf(` rewrite %s(.*) %s/$1 break; proxy_pass %s://%s; - %v`, path, location.Redirect.Target, proto, location.Backend, abu) + %v`, path, location.Redirect.Target, proto, upstreamName, abu) } // default proxy_pass