Skip to content

Commit

Permalink
fix: proxy protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
zdm committed Jan 2, 2024
1 parent aaf57d3 commit 61eb175
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/app/components/nginx/nginx/proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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( "" ) );
}

//
Expand Down

0 comments on commit 61eb175

Please sign in to comment.