mirror of
https://github.com/midoks/mdserver-web.git
synced 2026-10-10 02:39:26 +08:00
up
This commit is contained in:
@@ -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
|
||||
|
||||
+7
-2
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user