diff --git a/class/core/site_api.py b/class/core/site_api.py index a916e8c38..ad1934601 100755 --- a/class/core/site_api.py +++ b/class/core/site_api.py @@ -940,11 +940,11 @@ class site_api: if conf: if conf.find('ssl_certificate') == -1: return mw.returnJson(False, '当前未开启SSL') - to = '#error_page 404/404.html;\ - #HTTP_TO_HTTPS_START\ - if ($server_port !~ 443){\ - rewrite ^(/.*)$ https://$host$1 permanent;\ - }\ + to = '\n#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' conf = conf.replace('#error_page 404/404.html;', to) mw.writeFile(file, conf)