mirror of
https://github.com/caprover/caprover
synced 2026-05-03 18:20:32 +00:00
Added a simple script to fix nginx errors
This commit is contained in:
@@ -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