2
0
mirror of https://github.com/acepanel/panel.git synced 2026-02-04 10:17:17 +08:00

feat: 支持apache

This commit is contained in:
2026-01-13 01:55:20 +08:00
parent 06f6610d3b
commit a236ca9db8
2 changed files with 16 additions and 20 deletions

View File

@@ -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")