Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Archer3CL's avatar

404 Not Found NGINX Error

Im setting my first site using Forge/Linode so i follow the instructions on https://mattstauffer.co/blog/getting-your-first-site-up-and-running-in-laravel-forge

Now after creating the server i had 2 sites, the default site and mysite.com then i link my Name provider to my Linode public IP and when trying to acces that IP redirect me to the default site.

Then I deleted the default site and tried to acces to mysite.com but on the site just appeared "404 Not Found NGINX " and the address bar was pointing to my IP an not to my domain name.

Do I need an extra config after deleting the default site?

Help is appreciated

0 likes
14 replies
sitesense's avatar

When you added the site, did you set the "Root Domain" to the domain name that you wish to use?

Archer3CL's avatar

Yes. Following my example I put mysite.com as root domain

sitesense's avatar

You mean literally "mysite.com" ? Or is that just so that you don't mention your real domain here?

sitesense's avatar
Level 19

Assuming that you used your actual domain and have set the A record correctly in the DNS...

I don't know what is causing your IP to be displayed but the Not Found error could be that you haven't actually deployed your App yet. If you have then it might be better to just delete the site in Forge and start over.

Archer3CL's avatar

Well I just did a fresh installation. And I deploy my app on the default site. So I can access thru www.mysite.com but in the address bar change to the IP address of Linode. How can I change this?

Pd mysite.com it's an example site not the real one

mehany's avatar

@Archer3CL how did you delete the default? and did you restart NGINX after doing these changes?

mehany's avatar
but in the address bar change to the IP address of Linode. How can I change this?
@Archer3CL once example.com ( your domain name ) is set to be default in NGINX like so
 listen 80 default_server;
 listen [::]:80 default_server;
 server_name example.com www.example.com;
 root /home/forge/example.com/html;

The servers IP will point to this site's directory. Hope that helped!

sitesense's avatar

I would recommend that you delete the default site in Forge before adding anything, otherwise you'll hit problems if you need to add other sites to the same server.

Archer3CL's avatar

Hi, sorry for late answer.

I just did what @sitesense told me, i just delete the site on forge and did the changes.

@mehany Yes, im managing the server from Forge interface.

I dont know what happened. But after a while the site was up and running with the correct address name.

So i think this can be closed. Thanks for your help

azimidev's avatar

Apparently, forge doesn't generate the nginx.conf for your IP.

Need to change

listen 80;
listen [::]:80;

To

listen 80 default_server;
listen [::]:80 default_server;

in your /etc/sites-available/yourdomain.com

Please or to participate in this conversation.