pull/149/head
midoks 3 years ago
parent dc5670fc39
commit 91debbbee1
  1. 7
      class/core/mw.py
  2. 4
      class/core/site_api.py

@ -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():

@ -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)

Loading…
Cancel
Save