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

MyBrainMightexplode()'s avatar

Jetstream InertiaJS 404 on routes

Issue:

The Log in (/login) and Register (/register) links on the homepage (which is rendering) are returning the NGINX 404 page in a modal.

Current status and efforts:

Status:

New install on a new LEMP droplet on DO

Laravel v9.9.0 PHP v8.0.17

nginx/1.18.0

Ubuntu 20.04

Console & Network tabs of DEV tools show nothing other than 404's for the request.

php artisan route:list shows a valid starting list for the routes

database connection is good

CNAME on DNS working and url being hit is pointing at server & .env has the correct url with https (cert is through cloudflare)

Actions taken:

Composer install as non root

Composer update as non root

php artisan migrate

npm install && npm run dev

npm run watch

php artisan route:cache

php artisan route:clear

php artisan cache:clear

php artisan view:clear

systemctl restart nginx

systemctl restart php8.0-fpm

0 likes
5 replies
Niush's avatar

Possibly the APP_URL, in .env is incorrect or not being read?

Niush's avatar

@MyBrainMightexplode() Clearly the request is not reaching Laravel, so, may be Nginx is not listening at 443 and the URL is using https ? (or not listening 80 and using http)

MyBrainMightexplode()'s avatar

@Niush you're definitely right I think

I've done other Laravel apps on this domain with different subdomains before but never with InertiaJS, however I've deployed about a dozen Jetstream/Inertia apps on other domains.

I spent the last few days trying everything I can think of.

  • I've uninstalled and reinstalled ssl certs
  • I've guaranteed my server setups were correct
  • Placed URL::forceScheme('https'); at the top of my web.php route
  • Cleared all caches
  • Updated .env APP_URL=https://domain.com
  • Changed php versions between 8.0, 8.1, & 8.2

I've created and destroyed about 6 servers just to keep starting fresh and never get any closer

I finally changed to an LAMP from LEMP and I am now getting the exact same 404 modal on the links

At this point I'm going to abandon Inertia because there seems to be something broken within the last couple weeks with the source and I've wasted about a week and a half just trying to get it to square one.

devstu's avatar

I ran across this same issue with a recent build and for me I needed to enable the rewrite module.

Please or to participate in this conversation.