HTTP 404 · 4XX RFC 9110 §15.5.5 Cacheable: Yes (heuristically) Retryable: No

HTTP 404 Not Found: Root Causes & Production Fix Guide

HTTP 404 Not Found means the server cannot map the requested URI to a resource. Beyond deleted pages, the #1 developer cause is refreshing a client-side React/Vue/Next SPA route without a server fallback.

Top Root Causes of HTTP 404

Nginx SPA Fallback & Clean 404 Page Config

server {
    root /var/www/app/dist;
    error_page 404 /404.html;
    location / {
        try_files $uri $uri/ /index.html;
    }
    location /api/ {
        proxy_pass http://127.0.0.1:4000;
    }
}

Verify with cURL

curl -i -sS https://example.com/dashboard/settings

Interactive Stack Diagnoser (HTTP 404)

Frequently Asked Questions

Why does my React/Vue route work on click but 404 on page reload?

Client-side routers intercept clicks in JS, but a hard refresh asks the web server for that URL. Add `try_files $uri $uri/ /index.html;` in Nginx or a rewrite rule on Cloudflare/Netlify.

What is a Soft 404 in Google Search Console?

A Soft 404 happens when a missing page returns HTTP 200 OK with 'Not Found' text instead of a genuine 404 status code, wasting crawl budget.

Should API 404 responses return HTML or JSON?

Always return JSON (ideally RFC 9457 `application/problem+json`) for `/api/*` routes so clients do not crash parsing HTML.

Related Status Guides & Header Tools