host 0.0.0.0 setting do not work in production mode
See original GitHub issueEnvironment
- Operating System:
Windows_NT
- Node Version:
v14.16.0
- Nuxt Version:
3.0.0-27319101.3e82f0f
- Package Manager:
yarn@1.22.17
- Bundler:
Vite
- User Config:
buildModules
,css
,privateRuntimeConfig
,meta
,vite
,build
- Runtime Modules:
-
- Build Modules:
nuxt-windicss@2.1.1
,@intlify/nuxt3@0.1.9
Reproduction
nuxt.config.js
import { defineNuxtConfig } from 'nuxt3'
export default defineNuxtConfig({
...,
vite: {
server: {
host: '0.0.0.0'
}
}
})
Describe the bug
When I run yarn dev
, it works as I expect:
> Local: http://localhost:5555/
> Network: http://xxx.xxx.x.xxx:5555/
But when running yarn build
& yarn start
:
I can only access http://localhost:3000/
Listening on http://localhost:3000
I’m not sure is that a bug or not. Or, is there any way to access the public address in production mode?
Additional context
No response
Logs
No response
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Flask not able to run on 0.0.0.0 - Stack Overflow
I am not able to run Flask on host 0.0.0.0. When I run it with 0.0.0.0, it instead shows my Local IP address....
Read more >DevServer - webpack
webpack-dev-server can be used to quickly develop an application. See the development guide to get started. This page describes the options that affect...
Read more >Settings - Uvicorn
Settings ¶. Use the following options to configure Uvicorn, when running from the command line. If you're running programmatically, using uvicorn.run(.
Read more >Configure endpoints for the ASP.NET Core Kestrel web server
If no ports are specified, Kestrel binds to http://localhost:5000 . ... For SNI to function, the client sends the host name for the...
Read more >Quickstart — Flask Documentation (2.2.x)
flask run --host=0.0.0.0 ... Do not run the development server or debugger in a production environment. To enable debug mode, use the --debug...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
cross-env
pkg.package.json
Hi, @kevinadhiguna. I don’t know how to set Nuxt env in the most correct way. But maybe you can try this one:
.env
package.json
It works for me.