|
@@ -89,10 +89,15 @@ func NewDynamicProxyCore(target *url.URL, prepender string) *ReverseProxy {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ //Hack the default transporter to handle more connections
|
|
|
+ http.DefaultTransport.(*http.Transport).MaxIdleConns = 1000
|
|
|
+ http.DefaultTransport.(*http.Transport).MaxIdleConnsPerHost = 1000
|
|
|
+
|
|
|
return &ReverseProxy{
|
|
|
Director: director,
|
|
|
Prepender: prepender,
|
|
|
Verbal: false,
|
|
|
+ Transport: http.DefaultTransport,
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -355,7 +360,7 @@ func (p *ReverseProxy) ProxyHTTP(rw http.ResponseWriter, req *http.Request, rrr
|
|
|
//locationRewrite = strings.ReplaceAll(locationRewrite, domainWithoutPort, rrr.OriginalHost)
|
|
|
} else if strings.HasPrefix(originLocation, "/") && rrr.PathPrefix != "" {
|
|
|
//Back to the root of this proxy object
|
|
|
- //fmt.Println(rrr.ProxyDomain, domainWithoutPort, rrr.OriginalHost)
|
|
|
+ //fmt.Println(rrr.ProxyDomain, rrr.OriginalHost)
|
|
|
locationRewrite = strings.TrimSuffix(rrr.PathPrefix, "/") + originLocation
|
|
|
} else {
|
|
|
//Relative path. Do not modifiy location header
|