Your new web server is ready to use - how to show my website on next.js instead of that message

I use hostinger + hestiaCP
I have VPS hosting on Ubuntu 22.04 64bit with HestiaCP

I see this guide
This website don’t let me to paste more than 2 links - so in YouTube enter
How to Deploy a Next.js app to a Custom Server - NOT Vercel! (Full Beginner Tutorial)

I want to see my website that I created wtih next.js

I already configured nginx
/etc/nginx/sites-available/nextjs.conf

server {
  listen 80;
  server_name 89.116.152.101;

  location / {
    proxy_pass http://localhost:3000;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection 'upgrade';
    proxy_set_header Host $host;
    proxy_cache_bypass $http_upgrade;
  }
}

I get stuck here - https://youtu.be/HIb4Ucs_foQ?t=1125

When I visit IP address I see “Your new web server is ready to use” instead of my website

For now I just expect that after pnpm build and pnpm start will see my actuall website instead of “Your new web server is ready to use” message

If you know how to fix it you may help me in google-meets or discord (so it will faster) - just message me in telegram - nicitaacom

Also I’m expecting that you message me some basic stuff I need to run in my terminal to see my website intead of “Your new web server is ready to use” message

h
This config will never load make use of a templates as instucted here:

1 Like

I see this

I don’t see that in docs something about usage

Can you please provide some steps I need to do to fix “Your new web server is ready to use” issue?
I mean what sould I type in my terminal to fix it?

I checked this guide - https://www.youtube.com/watch?v=tCUGy_aZ0FM
But it don’t work for me (I runned all commands from that guide and still see this “success” message

Thank you for fast reply

Ok I figure out it

http://89.116.152.101/

Now I see 502 Bad Gateway

How to see my website when I go to 89.116.152.101

I’m sure that my next.js project already runned on localhost:3000

I just need to setup redirect somehow from 89.116.152.101 to localhost:3000

Can you help me please with that?
Some docs / YouTube guides / commands I need to run in terminal
Would be nice

Depending on your setup you need to create nextjs.tpl and nexjs.stpl in nginx folder (Nginx + Apache2) or nginx/php-fpm folder (Nginx stand alone folder)

Create a copy of default.tpl and .stpl and make your changes

The go to edit web and alter the template for that domain and it should work out of the box

I configured files but still see 502 bad gateway

nextjs.tpl

server {
    listen %ip%:%web_ssl_port%;
    server_name %domain_idn% %alias_idn%;
    root %docroot%;

    location / {
        proxy_pass http://localhost:3000;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
    }

    include %home%/%user%/conf/web/nginx.%domain_idn%.conf*;
}

nextjs.stpl

server {
    listen %ip%:%web_ssl_port%;
    server_name %domain_idn% %alias_idn%;
    root %docroot%;

    location / {
        proxy_pass http://localhost:3000;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
    }

    include %home%/%user%/conf/web/nginx.%domain_idn%.conf*;
}
cd ~/26_hot-delivery
pnpm start

(my server runned on http://localhost:3000)

And when I go to the 89.116.152.101
It don’t redirect me to http://locahost:3000

I’m expecting that it redirect me - so I will se my website

For nextjs.stpl it I missing all the infomation for valid ssl pages …

Also does curl -I http://localhost:3000 work?

Yes curl return html css js bundle that I got from pnpm build

Then when you visit domain.com and setup .stpl correctly it should work

1 Like

I figure out it
In this guide I show not only how to fix “Your new web server is ready to use” message (it common if you use some control panel - so you may not change nginix config for that reason)
But also I show how to deploy 2 next.js projects on 1 VPS and send and recieve emails from your own domain (with hesiaCP its not possible - I tried it and redirection to recieve emails doesn’t work)