mirror of
https://github.com/acepanel/panel.git
synced 2026-02-04 10:17:17 +08:00
feat: 支持apache
This commit is contained in:
@@ -7,7 +7,6 @@ import (
|
||||
"regexp"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/acepanel/panel/pkg/webserver/types"
|
||||
)
|
||||
@@ -106,13 +105,6 @@ func parseProxyFile(filePath string) (*types.Proxy, error) {
|
||||
proxy.Cache = true
|
||||
}
|
||||
|
||||
// 解析 ProxyTimeout (resolver timeout)
|
||||
timeoutPattern := regexp.MustCompile(`ProxyTimeout\s+(\d+)`)
|
||||
if tm := timeoutPattern.FindStringSubmatch(contentStr); tm != nil {
|
||||
timeout, _ := strconv.Atoi(tm[1])
|
||||
proxy.ResolverTimeout = time.Duration(timeout) * time.Second
|
||||
}
|
||||
|
||||
// 解析 Substitute (响应内容替换)
|
||||
subPattern := regexp.MustCompile(`Substitute\s+"s/([^/]+)/([^/]*)/[gin]*"`)
|
||||
subMatches := subPattern.FindAllStringSubmatch(contentStr, -1)
|
||||
@@ -236,11 +228,6 @@ func generateProxyConfig(proxy types.Proxy) string {
|
||||
sb.WriteString(" ProxyIOBufferSize 65536\n")
|
||||
}
|
||||
|
||||
// Timeout 配置
|
||||
if proxy.ResolverTimeout > 0 {
|
||||
sb.WriteString(fmt.Sprintf(" ProxyTimeout %d\n", int(proxy.ResolverTimeout.Seconds())))
|
||||
}
|
||||
|
||||
// Cache 配置
|
||||
if proxy.Cache {
|
||||
sb.WriteString(" <IfModule mod_cache.c>\n")
|
||||
|
||||
Reference in New Issue
Block a user