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

lara56278's avatar

Nginx 404 error on new app

Okay,

I am aware this seems to have been covered before but I cannot for the life of me get this to work on Forge.

I have:

  1. created a new server
  2. deleted the default site
  3. placed my new site with the repo on and told it to deploy
  4. I am aware that Nginx probably needs to restart after I delete the 'default' site but I cannot tell if hitting restart is actually working.

Any ideas of what might be causing me to have a 404 page.

It is a laravel project - very simple under construction splash page.

Any help is appreciated.

0 likes
7 replies
lara56278's avatar

I did not touch those settings as it is my understanding that Forge sets up all of the needed config settings for nginx to work with a laravel project.

If that is not the case, I see nothing in any instructions on the site for doing so.

Ishatanjeeb's avatar

"etc/nginx/sites-available" can you share this files?

lara56278's avatar

Okay, checked it live on the web via the dns name and it now seems to be working.

However, if trying to reach the site via the ip address, it throws a 404 error. Odd behavior but at least the domain name is now working.

stueynet's avatar

If you tried to reach the site by the IP address, that would normally have been handled by the default site. Since you deleted it, it is handled by the catch-all nginx config which returns a 404.

stueynet's avatar

Although that being said, I am finding when I delete the default site it actually redirects me to the first available site on the server. Hmmm.

lara56278's avatar

I am fairly new to configuring servers and web servers, hence why I decided to go with Forge since it makes the process SO much easier. Still learning the in's and out's of it clearly.

Might have to finish making my dev server for testing and see what the default nginx config file shows compared to the one I set up for the client. Makes sense that those files would be different - I just assumed Forge would make the necessary adjustments to reach a site via the domain name AND the IP, but maybe I am wrong.

Either way, it's working and I appreciate both of you jumping in with trying to help.

Cheers!

Please or to participate in this conversation.