pull/866/head
dami 2 months ago
parent ea5df706a8
commit 4f12a096e7
  1. 16
      web/core/mw.py
  2. 9
      web/utils/site.py

@ -931,6 +931,22 @@ def isSupportHttp3(version):
return True
return False
def isVhostHasReuseport():
vhost_dir = getServerDir() + '/web_conf/nginx/vhost'
if not os.path.exists(vhost_dir):
return False
try:
for filename in os.listdir(vhost_dir):
if filename.endswith('.conf'):
filepath = os.path.join(vhost_dir, filename)
content = readFile(filepath)
if content and 'reuseport' in content:
return True
except:
pass
return False
def isDebugMode():
if isAppleSystem():
return True

@ -554,11 +554,16 @@ class sites(object):
tmp = re.findall(rep, conf)
if not mw.inArray(tmp, '443'):
listen = re.search(rep, conf).group()
quic_conf = "quic reuseport"
if mw.isVhostHasReuseport():
quic_conf = "quic"
if mw.isSupportHttp3(version):
http_ssl = "\n\tlisten 443 ssl;"
http_ssl = http_ssl + "\n\tlisten [::]:443 ssl;"
http_ssl = http_ssl + "\n\tlisten 443 quic;#reuseport"
http_ssl = http_ssl + "\n\tlisten [::]:443 quic;"
http_ssl = http_ssl + "\n\tlisten 443 "+quic_conf+";"
http_ssl = http_ssl + "\n\tlisten [::]:443 "+quic_conf+";"
http_ssl = http_ssl + "\n\thttp3 on;"
http_ssl = http_ssl + "\n\thttp2 on;"
else:

Loading…
Cancel
Save