mirror of
https://github.com/midoks/mdserver-web.git
synced 2026-10-18 23:45:52 +08:00
up
This commit is contained in:
@@ -931,6 +931,22 @@ def isSupportHttp3(version):
|
|||||||
return True
|
return True
|
||||||
return False
|
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():
|
def isDebugMode():
|
||||||
if isAppleSystem():
|
if isAppleSystem():
|
||||||
return True
|
return True
|
||||||
|
|||||||
+7
-2
@@ -554,11 +554,16 @@ class sites(object):
|
|||||||
tmp = re.findall(rep, conf)
|
tmp = re.findall(rep, conf)
|
||||||
if not mw.inArray(tmp, '443'):
|
if not mw.inArray(tmp, '443'):
|
||||||
listen = re.search(rep, conf).group()
|
listen = re.search(rep, conf).group()
|
||||||
|
|
||||||
|
quic_conf = "quic reuseport"
|
||||||
|
if mw.isVhostHasReuseport():
|
||||||
|
quic_conf = "quic"
|
||||||
|
|
||||||
if mw.isSupportHttp3(version):
|
if mw.isSupportHttp3(version):
|
||||||
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\tlisten [::]:443 ssl;"
|
||||||
http_ssl = http_ssl + "\n\tlisten 443 quic;#reuseport"
|
http_ssl = http_ssl + "\n\tlisten 443 "+quic_conf+";"
|
||||||
http_ssl = http_ssl + "\n\tlisten [::]:443 quic;"
|
http_ssl = http_ssl + "\n\tlisten [::]:443 "+quic_conf+";"
|
||||||
http_ssl = http_ssl + "\n\thttp3 on;"
|
http_ssl = http_ssl + "\n\thttp3 on;"
|
||||||
http_ssl = http_ssl + "\n\thttp2 on;"
|
http_ssl = http_ssl + "\n\thttp2 on;"
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user