浏览代码

auto update script executed

Toby Chui 1 年之前
父节点
当前提交
77bfba3fd9
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      mod/dynamicproxy/dpcore/utils.go

+ 3 - 1
mod/dynamicproxy/dpcore/utils.go

@@ -26,7 +26,9 @@ func replaceLocationHost(urlString string, rrr *ResponseRewriteRuleSet, useTLS b
 	//E.g. Proxy config: blog.example.com -> example.com/blog
 	//Check if it is actually redirecting to example.com instead of a new domain
 	//like news.example.com.
-	if rrr.ProxyDomain != u.Host {
+	// The later check bypass apache screw up method of redirection header
+	// e.g. https://imuslab.com -> http://imuslab.com:443
+	if rrr.ProxyDomain != u.Host && !strings.Contains(u.Host, rrr.OriginalHost+":") {
 		fmt.Println(rrr.ProxyDomain, u.Host, rrr.OriginalHost)
 		//New location domain not matching proxy target domain.
 		//Do not modify location header