I ran into the problem that when deploying the next application on the ubuntu server, and starting the production build (or even just dev), I can’t open this application by specifying the server address and port. I tried to make a deployment on 2 servers. The result is equally unfortunate. Also on one of the servers I tried to deploy a default project created through the
npx create-next-app@latest --typescript
command. The result is similar.
I know there is a way to deploy the project on the vercel hosting. There are also quite a lot of tutorials on proxying using nginx to go to the site using a domain name. But I can’t figure out how I can just deploy a project and open it by specifying a bare port and ip?
2
Answers
I decided to return to the already closed question (perhaps it will save someone time).
Friends, if you are in the same situation and cannot reach your application on a remote server (and at the same time the local curl gives you an html document) check 2 things:
IMHO this is a classic, and I’ll bet my chastity on your service not listening on 0.0.0.0, but instead on localhost or local network…
There is probably a configuration file somewhere where you can set the host to be "0.0.0.0" to listen to all networks.