mirror of
https://github.com/bunkerity/bunkerweb
synced 2026-05-24 09:28:37 +00:00
Add Nginx configuration check and reload logs when calling BunkerWeb /reload
This commit is contained in:
parent
86008e61f8
commit
f0328db3d6
1 changed files with 2 additions and 0 deletions
|
|
@ -94,10 +94,12 @@ end
|
|||
|
||||
api.global.POST["^/reload$"] = function(self)
|
||||
-- Check config
|
||||
logger:log(NOTICE, "Checking Nginx configuration")
|
||||
local status = execute("nginx -t")
|
||||
if status ~= 0 then
|
||||
return self:response(HTTP_INTERNAL_SERVER_ERROR, "error", "config check failed")
|
||||
end
|
||||
logger:log(NOTICE, "Nginx configuration is valid, reloading Nginx")
|
||||
-- Send HUP signal to master process
|
||||
local ok, err = kill(get_master_pid(), "HUP")
|
||||
if not ok then
|
||||
|
|
|
|||
Loading…
Reference in a new issue