remove location type from nginx filename

this will keep it consistent with upcoming cert filenames
This commit is contained in:
Girish Ramakrishnan
2022-11-17 08:24:57 +01:00
parent 0c8b8346f4
commit 293b8a0d34
2 changed files with 2 additions and 20 deletions

View File

@@ -481,24 +481,6 @@ async function writeDashboardConfig(domainObject) {
await reload();
}
function getNginxConfigFilename(app, fqdn, type) {
assert.strictEqual(typeof app, 'object');
assert.strictEqual(typeof fqdn, 'string');
assert.strictEqual(typeof type, 'string');
let nginxConfigFilenameSuffix = '';
if (type === apps.LOCATION_TYPE_ALIAS) {
nginxConfigFilenameSuffix = `-alias-${fqdn.replace('*', '_')}`;
} else if (type === apps.LOCATION_TYPE_SECONDARY) {
nginxConfigFilenameSuffix = `-secondary-${fqdn}`;
} else if (type === apps.LOCATION_TYPE_REDIRECT) {
nginxConfigFilenameSuffix = `-redirect-${fqdn}`;
}
return path.join(paths.NGINX_APPCONFIG_DIR, `${app.id}${nginxConfigFilenameSuffix}.conf`);
}
async function writeAppNginxConfig(app, fqdn, type, certificatePath) {
assert.strictEqual(typeof app, 'object');
assert.strictEqual(typeof fqdn, 'string');
@@ -563,7 +545,7 @@ async function writeAppNginxConfig(app, fqdn, type, certificatePath) {
}
const nginxConf = ejs.render(NGINX_APPCONFIG_EJS, data);
const filename = getNginxConfigFilename(app, fqdn, type);
const filename = path.join(paths.NGINX_APPCONFIG_DIR, `${app.id}-${fqdn.replace('*', '_')}.conf`);
debug(`writeAppNginxConfig: writing config for "${fqdn}" to ${filename} with options ${JSON.stringify(data)}`);
if (!safe.fs.writeFileSync(filename, nginxConf)) {
debug(`Error creating nginx config for "${app.fqdn}" : ${safe.error.message}`);