skip to Main Content

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


  1. Chosen as BEST ANSWER

    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:

    1. Check that the firewall is not blocking the necessary ports (in my case, this was the problem)
    2. If your project is located in the root user directory, allow access to your web server to ensure that scripts and style files are loaded (but this may not be safe) or move the project to another folder (a safer option)

  2. 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.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search