From b26f75f3a339c7efacbbc383fae472812bb812b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=97=E5=AD=90?= Date: Fri, 8 Dec 2023 01:38:04 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=B0=83=E6=95=B4=20reuseport=20?= =?UTF-8?q?=E5=90=AF=E7=94=A8=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/website.go | 4 ++-- scripts/openresty/install.sh | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/services/website.go b/app/services/website.go index 86cb624687..5939847e25 100644 --- a/app/services/website.go +++ b/app/services/website.go @@ -357,9 +357,9 @@ func (r *WebsiteImpl) SaveConfig(config requests.SaveConfig) error { vStr := cast.ToString(v) if v == 443 && config.Ssl { vStr = ` listen 443 ssl; - listen [::]:443 ssl; + listen [::]:443 ssl; listen 443 quic; - listen [::]:443 quic;` + listen [::]:443 quic;` port.WriteString(vStr) if i != len(ports)-1 { port.WriteString("\n") diff --git a/scripts/openresty/install.sh b/scripts/openresty/install.sh index 6b94fd7e82..f329a15679 100644 --- a/scripts/openresty/install.sh +++ b/scripts/openresty/install.sh @@ -552,8 +552,10 @@ EOF cat > ${openrestyPath}/conf/default.conf << EOF server { - listen 80 default_server; - listen 443 ssl default_server; + listen 80 default_server reuseport; + listen [::]:80 default_server reuseport; + listen 443 ssl default_server reuseport; + listen [::]:443 ssl default_server reuseport; server_name _; index index.html; root /www/server/openresty/html;