From 2f1599d8e0c37d3e016039295dfa96a88b0d0528 Mon Sep 17 00:00:00 2001 From: bangbang93 Date: Wed, 15 Jun 2022 19:02:10 +0800 Subject: [PATCH] fix nginx template --- src/cluster.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/cluster.ts b/src/cluster.ts index 9b68c4a..16ac148 100644 --- a/src/cluster.ts +++ b/src/cluster.ts @@ -166,8 +166,9 @@ export class Cluster { public async setupNginx(pwd: string, appPort: number, proto: string): Promise { this._port++ const dir = await mkdtemp(join(tmpdir(), 'openbmclapi')) - const confFile = proto === 'https' ? `${dir}/nginx/nginx.conf` : `${dir}/nginx/nginx-http.conf` - const confTemplate = await readFile(join(__dirname, '..', 'nginx', 'nginx.conf'), 'utf8') + const confFile = `${dir}/nginx/nginx.conf` + const templateFile = proto === 'https' ? 'nginx.conf' : 'nginx-http.conf' + const confTemplate = await readFile(join(__dirname, '..', 'nginx', templateFile), 'utf8') console.log('nginx conf', confFile) await copy(join(__dirname, '..', 'nginx'), dirname(confFile), {recursive: true, overwrite: true})