mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2025-08-04 00:13:33 +00:00
dep updates/enable ssl_dyn_rec_enable/fix nginx in background/remove tempwrite
Signed-off-by: Zoey <zoey@z0ey.de>
This commit is contained in:
@@ -5,6 +5,8 @@ const config = require('../lib/config');
|
||||
const utils = require('../lib/utils');
|
||||
const error = require('../lib/error');
|
||||
|
||||
const NgxPidFilePath = '/usr/local/nginx/logs/nginx.pid';
|
||||
|
||||
const internalNginx = {
|
||||
|
||||
/**
|
||||
@@ -111,11 +113,21 @@ const internalNginx = {
|
||||
/**
|
||||
* @returns {Promise}
|
||||
*/
|
||||
|
||||
reload: () => {
|
||||
return internalNginx.test()
|
||||
.then(() => {
|
||||
logger.info('Restarting Nginx');
|
||||
return utils.exec('kill $(cat /usr/local/nginx/logs/nginx.pid); nginx');
|
||||
if (fs.existsSync(NgxPidFilePath)) {
|
||||
const ngxPID = fs.readFileSync(NgxPidFilePath, 'utf8').trim();
|
||||
if (ngxPID.length > 0) {
|
||||
logger.info('Killing Nginx');
|
||||
utils.exec(`kill ${ngxPID}`);
|
||||
}
|
||||
}
|
||||
logger.info('Starting Nginx in three seconds');
|
||||
setTimeout(() => {
|
||||
utils.execfg('nginx');
|
||||
}, 3000);
|
||||
});
|
||||
},
|
||||
|
||||
@@ -159,10 +171,10 @@ const internalNginx = {
|
||||
{certificate: host.certificate}, host.locations[i]);
|
||||
|
||||
if (locationCopy.forward_host.indexOf('/') > -1) {
|
||||
const splitted = locationCopy.forward_host.split('/');
|
||||
const split = locationCopy.forward_host.split('/');
|
||||
|
||||
locationCopy.forward_host = splitted.shift();
|
||||
locationCopy.forward_path = `/${splitted.join('/')}`;
|
||||
locationCopy.forward_host = split.shift();
|
||||
locationCopy.forward_path = `/${split.join('/')}`;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line
|
||||
|
Reference in New Issue
Block a user