|
@@ -353,8 +353,14 @@ func (p *ReverseProxy) ProxyHTTP(rw http.ResponseWriter, req *http.Request, rrr
|
|
|
//Full path
|
|
|
//Replace the forwarded target with expected Host
|
|
|
fmt.Println(rrr.ProxyDomain, domainWithoutPort, rrr.OriginalHost)
|
|
|
- locationRewrite = strings.ReplaceAll(locationRewrite, rrr.ProxyDomain, rrr.OriginalHost)
|
|
|
- locationRewrite = strings.ReplaceAll(locationRewrite, domainWithoutPort, rrr.OriginalHost)
|
|
|
+ lr, err := replaceLocationHost(locationRewrite, rrr.OriginalHost)
|
|
|
+ if err == nil {
|
|
|
+ locationRewrite = lr
|
|
|
+ }
|
|
|
+ //locationRewrite = strings.ReplaceAll(locationRewrite, rrr.ProxyDomain, rrr.OriginalHost)
|
|
|
+ //locationRewrite = strings.ReplaceAll(locationRewrite, domainWithoutPort, rrr.OriginalHost)
|
|
|
+ } else {
|
|
|
+ //Relative path. Do not modifiy location header
|
|
|
}
|
|
|
|
|
|
//Custom redirection to this rproxy relative path
|