Update site_api.py

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

@ -2772,6 +2772,12 @@ location ^~ {from} {\n\
file = self.getHostConf(siteName) file = self.getHostConf(siteName)
conf = mw.readFile(file) 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' keyPath = self.sslDir + '/' + siteName + '/privkey.pem'
certPath = self.sslDir + '/' + siteName + '/fullchain.pem' certPath = self.sslDir + '/' + siteName + '/fullchain.pem'
if conf: if conf:
@ -2799,6 +2805,10 @@ location ^~ {from} {\n\
listen = re.search(rep, conf).group() listen = re.search(rep, conf).group()
http_ssl = "\n\tlisten 443 ssl http2;" http_ssl = "\n\tlisten 443 ssl http2;"
http_ssl = 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) conf = conf.replace(listen, listen + http_ssl)
mw.backFile(file) mw.backFile(file)

Loading…
Cancel
Save