Update site_api.py

pull/542/head
Mr Chen 1 year ago
parent d3a5b9874b
commit c2d6f5408d
  1. 12
      class/core/site_api.py

@ -2767,11 +2767,17 @@ location ^~ {from} {\n\
mw.writeLog('TYPE_SITE', '设置成功,站点到期后将自动停止!', (siteName, edate))
return mw.returnJson(True, '设置成功,站点到期后将自动停止!')
# ssl相关方法 start
# ssl相关方法 start
def setSslConf(self, siteName):
file = self.getHostConf(siteName)
conf = mw.readFile(file)
version = ''
version_file_pl = mw.getServerDir() + '/openresty/version.pl'
if os.path.exists(version_file_pl):
version = mw.readFile(version_file_pl)
keyPath = self.sslDir + '/' + siteName + '/privkey.pem'
certPath = self.sslDir + '/' + siteName + '/fullchain.pem'
if conf:
@ -2799,6 +2805,10 @@ location ^~ {from} {\n\
listen = re.search(rep, conf).group()
http_ssl = "\n\tlisten 443 ssl http2;"
http_ssl = http_ssl + "\n\tlisten [::]:443 ssl http2;"
if version == '1.25.3.1':
http_ssl = http_ssl + "\n\tlisten 443 quic;"
conf = conf.replace(listen, listen + http_ssl)
mw.backFile(file)

Loading…
Cancel
Save