|
@@ -97,7 +97,7 @@ func (h *ProxyHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|
|
//Virtual directory routing rule found. Route via vdir mode
|
|
|
h.vdirRequest(w, r, targetProxyEndpoint)
|
|
|
return
|
|
|
- } else if !strings.HasSuffix(proxyingPath, "/") {
|
|
|
+ } else if !strings.HasSuffix(proxyingPath, "/") && sep.ProxyType != ProxyType_Root {
|
|
|
potentialProxtEndpoint := sep.GetVirtualDirectoryHandlerFromRequestURI(proxyingPath + "/")
|
|
|
if potentialProxtEndpoint != nil {
|
|
|
//Missing tailing slash. Redirect to target proxy endpoint
|
|
@@ -155,7 +155,7 @@ func (h *ProxyHandler) handleRootRouting(w http.ResponseWriter, r *http.Request)
|
|
|
fallthrough
|
|
|
case DefaultSite_ReverseProxy:
|
|
|
//They both share the same behavior
|
|
|
- h.vdirRequest(w, r, h.Parent.Root)
|
|
|
+ h.hostRequest(w, r, h.Parent.Root)
|
|
|
case DefaultSite_Redirect:
|
|
|
redirectTarget := strings.TrimSpace(proot.DefaultSiteValue)
|
|
|
if redirectTarget == "" {
|
|
@@ -166,7 +166,7 @@ func (h *ProxyHandler) handleRootRouting(w http.ResponseWriter, r *http.Request)
|
|
|
parsedURL, err := url.Parse(proot.DefaultSiteValue)
|
|
|
if err != nil {
|
|
|
//Error when parsing target. Send to root
|
|
|
- h.vdirRequest(w, r, h.Parent.Root)
|
|
|
+ h.hostRequest(w, r, h.Parent.Root)
|
|
|
return
|
|
|
}
|
|
|
hostname := parsedURL.Hostname()
|