This commit is contained in:
midoks 2022-08-07 21:38:44 +08:00
parent dc5670fc39
commit 91debbbee1
2 changed files with 8 additions and 3 deletions

View File

@ -98,7 +98,12 @@ def systemdCfgDir():
return cfg_dir
# debian,centos
return "/usr/lib/systemd/system"
cfg_dir = '/usr/lib/systemd/system'
if os.path.exists(cfg_dir):
return cfg_dir
# local test
return "/tmp"
def getOs():

View File

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