Skip to content

Commit

Permalink
Set standalone server default hostname to 0.0.0.0 (#54445)
Browse files Browse the repository at this point in the history
By default Next.js listens on localhost, platforms like Google Cloud Run and fly.io will fail to deploy apps that listen on `localhost`, Next.js should bind to `0.0.0.0` instead

Related to #54342
Fixes #49777
Fixes #54133
  • Loading branch information
remorses authored Sep 14, 2023
1 parent 724ece8 commit 42ad2ce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/next/src/build/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1984,7 +1984,7 @@ if (!process.env.NEXT_MANUAL_SIG_HANDLE) {
}
const currentPort = parseInt(process.env.PORT, 10) || 3000
const hostname = process.env.HOSTNAME || 'localhost'
const hostname = process.env.HOSTNAME || '0.0.0.0'
let keepAliveTimeout = parseInt(process.env.KEEP_ALIVE_TIMEOUT, 10)
const nextConfig = ${JSON.stringify({
Expand Down

0 comments on commit 42ad2ce

Please sign in to comment.