HTTP 404 Not Found Status Code

4xx Client Error · RFC 9110 §15.5.5 · Origin server did not find a representation for the target URI

404 Not Found RFC 9110 §15.5.5
Open /404/ →
Response & Header Builder
1m
max-age: 1m
Editable Response Body
Live Raw HTTP Response 6 headers · 143 bytes
HTTP/1.1 404 Not Found
Date: Tue, 24 Nov 2026 12:00:00 GMT
Content-Type: application/json; charset=utf-8
Content-Length: 143
Cache-Control: public, max-age=60
Content-Type: application/problem+json; charset=utf-8
X-Content-Type-Options: nosniff

{"type":"https://bytehelpers.com/http-status/404/","title":"Not Found","status":404,"detail":"No resource exists at /v1/projects/prj_unknown."}
location /api/example {
    add_header Cache-Control "public, max-age=60" always;
    add_header X-Content-Type-Options "nosniff" always;
    default_type application/json;
    return 404 '{"type":"https://bytehelpers.com/http-status/404/","title":"Not Found","status":404,"detail":"No resource exists at /v1/projects/prj_unknown."}';
}
Pairwise HTTP Confusion Comparator
Open /http-status/410/ →
Attribute 404 Not Found 410 Gone
Status & Phrase404 Not Found410 Gone
Category4xx Client Error4xx Client Error
SpecificationRFC 9110 §15.5.5RFC 9110 §15.5.11
Core SemanticsIndicates that the origin server could not find a current representation for the target resource or is unwilling to disclose that one exists.Resource was intentionally and permanently removed with no forwarding address; search engines de-index faster than 404.
Cacheable by DefaultYesYes
Method PreservationN/AN/A
Safe to Auto-RetryNo (fix request first)No (fix request first)
Response Body AllowedYesYes
Key HeadersCache-Control, Content-TypeCache-Control
HTTP 404 Not Found Content-Length: 143 B Cacheable · Non-retryable
Ctrl+Enter: Copy Raw · 100% Browser-Local
Advertisement
Reserved fixed-height slot (CLS = 0.00) 728×90 320×100 300×50

Engineering Clean HTTP 404 Responses for APIs, SPAs, and Search Crawlers

HTTP 404 Not Found communicates that no resource exists at the requested URI without promising whether the absence is temporary or permanent. In REST APIs, always return a genuine 404 status line with a structured problem+json payload rather than returning 200 OK with {"found": false}. Returning 200 on missing web pages creates a "soft 404" that wastes crawl budget and confuses CDN analytics.

Because 404 is heuristically cacheable under RFC 9110, CDNs like Cloudflare and Fastly can cache 404 responses for several minutes unless you specify Cache-Control. That is great for absorbing bot scans against missing static assets, but dangerous on write-then-read APIs where a record might be created seconds after a lookup—use Cache-Control: no-store on dynamic API 404 responses.

  • RFC SpecificationRFC 9110 §15.5.5 (Client Error 4xx)
  • Default CacheabilityHeuristically cacheable by default per RFC 9110 §15.1
  • SEO GuidancePrefer 404 for unknown paths, 301 for moved paths, 410 for intentionally purged paths
What is the difference between HTTP 404 Not Found and 410 Gone?

404 means the resource is currently not found without stating if it ever existed. 410 Gone explicitly tells clients and search engines the resource existed previously and was permanently removed.

Why does refreshing a React or Vue route return 404 on Nginx?

Client-side routers handle virtual paths in JavaScript. Configure Nginx with try_files $uri $uri/ /index.html; for SPA routes, while keeping real missing API/asset routes returning true 404s.

Are HTTP 404 responses cached by CDNs?

Yes, 404 is cacheable by default under RFC 9110. Set Cache-Control: no-store on dynamic endpoints if newly created records must be visible immediately.