pull/865/head
dami 22 hours ago
parent 89f21867a5
commit e628f1f6d5
  1. 9
      web/core/mw.py
  2. 15
      web/utils/site.py

@ -922,6 +922,15 @@ def isSupportSystemctl():
return False
return True
def isSupportHttp3(version):
if version.startswith('1.25'):
return True
if version.startswith('1.27'):
return True
if version.startswith('1.29'):
return True
return False
def isDebugMode():
if isAppleSystem():
return True

@ -553,15 +553,14 @@ class sites(object):
tmp = re.findall(rep, conf)
if not mw.inArray(tmp, '443'):
listen = re.search(rep, conf).group()
if version.startswith('1.25') or version.startswith('1.27'):
http_ssl = "\n\tlisten 443 ssl;"
http_ssl = http_ssl + "\n\tlisten [::]:443 ssl;"
http_ssl = http_ssl + "\n\thttp2 on;"
else:
http_ssl = "\n\tlisten 443 ssl;"
http_ssl = http_ssl + "\n\tlisten [::]:443 ssl;"
http_ssl = "\n\tlisten 443 ssl;"
http_ssl = http_ssl + "\n\tlisten [::]:443 ssl;"
http_ssl = http_ssl + "\n\thttp2 on;"
if mw.isSupportHttp3(version):
http_ssl = "\n\thttp2 on;"
conf = conf.replace(listen, listen + http_ssl)

Loading…
Cancel
Save