mirror of
https://github.com/caprover/caprover
synced 2026-10-18 19:09:09 +00:00
Added a simple script to fix nginx errors
This commit is contained in:
1 parent
593925453c
commit
6bd0bb554c
1 file changed
+22
@@ -0,0 +1,22 @@
|
||||
/*jshint esversion: 6 */
|
||||
|
||||
const fs = require('fs-extra');
|
||||
const CONFIG_FILE_PATH = '/captain/data/config-captain.json';
|
||||
|
||||
const fileContent = JSON.parse(fs.readFileSync(CONFIG_FILE_PATH, {
|
||||
encoding: 'utf-8'
|
||||
}));
|
||||
|
||||
fs.writeFileSync(CONFIG_FILE_PATH + '.backup', JSON.stringify(fileContent));
|
||||
|
||||
|
||||
fileContent.nginxBaseConfig = '';
|
||||
fileContent.nginxCaptainConfig = '';
|
||||
|
||||
const apps = fileContent.appDefinitions || {};
|
||||
|
||||
Object.keys(apps).forEach(app => {
|
||||
apps[app].customNginxConfig = '';
|
||||
});
|
||||
|
||||
fs.writeFileSync(CONFIG_FILE_PATH, JSON.stringify(fileContent));
|
||||
Reference in new issue
Block a user