Update config_api.py

This commit is contained in:
midoks 2023-03-11 15:28:13 +08:00
parent d092d9f5f2
commit b0a44d24d4
1 changed files with 5 additions and 5 deletions

View File

@ -417,11 +417,11 @@ class config_api:
if conf.find('ssl_certificate') == -1:
return mw.returnJson(False, '当前未开启SSL')
to = "#error_page 404/404.html;\n\
# HTTP_TO_HTTPS_START\n\
if ($server_port !~ 443){\n\
rewrite ^(/.*)$ https://$host$1 permanent;\n\
}\n\
# HTTP_TO_HTTPS_END"
# HTTP_TO_HTTPS_START\n\
if ($server_port !~ 443){\n\
rewrite ^(/.*)$ https://$host$1 permanent;\n\
}\n\
# HTTP_TO_HTTPS_END"
conf = conf.replace('#error_page 404/404.html;', to)
mw.writeFile(panel_ssl, conf)
else: