|
@@ -238,6 +238,8 @@ func (p *ReverseProxy) ProxyHTTP(rw http.ResponseWriter, req *http.Request, rrr
|
|
transport = http.DefaultTransport
|
|
transport = http.DefaultTransport
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ hostname := req.Host
|
|
|
|
+
|
|
outreq := new(http.Request)
|
|
outreq := new(http.Request)
|
|
// Shallow copies of maps, like header
|
|
// Shallow copies of maps, like header
|
|
*outreq = *req
|
|
*outreq = *req
|
|
@@ -309,8 +311,6 @@ func (p *ReverseProxy) ProxyHTTP(rw http.ResponseWriter, req *http.Request, rrr
|
|
domainWithoutPort = strings.Split(rrr.ProxyDomain, ":")[0]
|
|
domainWithoutPort = strings.Split(rrr.ProxyDomain, ":")[0]
|
|
}
|
|
}
|
|
|
|
|
|
- hostname := req.Header.Get("Host")
|
|
|
|
-
|
|
|
|
//Replace the forwarded target with expected Host
|
|
//Replace the forwarded target with expected Host
|
|
locationRewrite = strings.ReplaceAll(locationRewrite, rrr.ProxyDomain, hostname)
|
|
locationRewrite = strings.ReplaceAll(locationRewrite, rrr.ProxyDomain, hostname)
|
|
locationRewrite = strings.ReplaceAll(locationRewrite, domainWithoutPort, hostname)
|
|
locationRewrite = strings.ReplaceAll(locationRewrite, domainWithoutPort, hostname)
|