From 95f6d75c1919e57c2e63de85013fe60df92b1a04 Mon Sep 17 00:00:00 2001 From: zryfish Date: Wed, 1 Apr 2020 15:23:29 +0800 Subject: [PATCH] fix proxy host bug (#1977) --- pkg/apiserver/dispatch/dispatch.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/apiserver/dispatch/dispatch.go b/pkg/apiserver/dispatch/dispatch.go index da9628b38..42385c55c 100644 --- a/pkg/apiserver/dispatch/dispatch.go +++ b/pkg/apiserver/dispatch/dispatch.go @@ -54,7 +54,7 @@ func (c *clusterDispatch) Dispatch(w http.ResponseWriter, req *http.Request, han } u := *req.URL - u.Host = agent.Spec.Proxy + u.Host = fmt.Sprintf("%s:%d", agent.Spec.Proxy, agent.Spec.KubeSphereAPIServerPort) u.Path = strings.Replace(u.Path, fmt.Sprintf("/clusters/%s", info.Cluster), "", 1) httpProxy := proxy.NewUpgradeAwareHandler(&u, http.DefaultTransport, true, false, c)