mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-19 02:37:24 +08:00
make reverse proxy insecure ssl (for influxdb)
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
||||
|
||||
"yunion.io/x/log"
|
||||
"yunion.io/x/onecloud/pkg/httperrors"
|
||||
"crypto/tls"
|
||||
)
|
||||
|
||||
type EndpointGenerator func(context.Context, http.ResponseWriter, *http.Request) (string, error)
|
||||
@@ -48,6 +49,9 @@ func (p *SReverseProxy) ServeHTTP(ctx context.Context, w http.ResponseWriter, r
|
||||
}
|
||||
log.Debugf("Forwarding to servie: %q, url: %q", p.serviceName, remoteUrl.String())
|
||||
proxy := httputil.NewSingleHostReverseProxy(remoteUrl)
|
||||
proxy.Transport = &http.Transport{
|
||||
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
|
||||
}
|
||||
r.Header.Del("Cookie")
|
||||
r.Header.Del("X-Auth-Token")
|
||||
proxy.ServeHTTP(w, r)
|
||||
|
||||
Reference in New Issue
Block a user