diff --git a/pkg/webserver/apache/proxy.go b/pkg/webserver/apache/proxy.go index bdd0d67e..0d8be255 100644 --- a/pkg/webserver/apache/proxy.go +++ b/pkg/webserver/apache/proxy.go @@ -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(" \n") diff --git a/web/src/views/website/EditView.vue b/web/src/views/website/EditView.vue index f84f5b5b..7d725b73 100644 --- a/web/src/views/website/EditView.vue +++ b/web/src/views/website/EditView.vue @@ -52,6 +52,7 @@ const { data: setting, send: fetchSetting } = useRequest(website.config(Number(i }) const { data: installedEnvironment } = useRequest(home.installedEnvironment, { initialData: { + webserver: 'nginx', php: [ { label: $gettext('Not used'), @@ -66,6 +67,9 @@ const { data: installedEnvironment } = useRequest(home.installedEnvironment, { ] } }) + +// 是否为 Nginx +const isNginx = computed(() => installedEnvironment.value.webserver === 'nginx') const certs = ref([]) useRequest(cert.certs(1, 10000)).onSuccess(({ data }) => { certs.value = data.items @@ -97,9 +101,13 @@ const selectedCert = ref(null) const handleSave = () => { // 如果开启了ssl但没有任何监听地址设置了ssl,则自动添加443 if (setting.value.ssl && !setting.value.listens.some((item: any) => item.args?.includes('ssl'))) { + const args = ['ssl'] + if (isNginx.value) { + args.push('quic') + } setting.value.listens.push({ address: '443', - args: ['ssl', 'quic'] + args }) } // 如果关闭了ssl,自动禁用所有ssl和quic @@ -409,6 +417,7 @@ const updateTimeoutUnit = (proxy: any, unit: string) => { HTTPS { style="width: 100%" /> - + @@ -621,14 +630,14 @@ const updateTimeoutUnit = (proxy: any, unit: string) => { - + - + { - +