diff --git a/lib/app/components/nginx/nginx/proxy.js b/lib/app/components/nginx/nginx/proxy.js index f3579f417..bb83ea06d 100644 --- a/lib/app/components/nginx/nginx/proxy.js +++ b/lib/app/components/nginx/nginx/proxy.js @@ -120,8 +120,14 @@ export default class NginxProxy { fs.writeFileSync( this.#streamConfigPath, config ); if ( serverNames.size ) { + const lines = []; + + for ( const [serverName, socketPath] of serverNames.emtrits() ) { + lines.push( `"${serverName}" "unix:${socketPath}";\n` ); + } + fs.mkdirSync( path.dirname( this.#serverNamesConfigPath ), { "recursive": true } ); - fs.writeFileSync( this.#serverNamesConfigPath, [...serverNames].map( serverName => `"${serverName}" "unix:${this.nginx.unixSocketsDir}/${this.id}.443.socket";\n` ).join( "" ) ); + fs.writeFileSync( this.#serverNamesConfigPath, lines.join( "" ) ); } //