# CloudFront 404 Not Found

> Fix an Amazon CloudFront 404: wrong origin path, missing object, a custom error page that returns 404, and how long CloudFront caches the error before retrying.

Canonical: https://scaplet.com/errors/cdn/cloudfront-404

Guide Error · CDN and hosting errors

Fix an Amazon CloudFront 404: wrong origin path, missing object, a custom error page that returns 404, and how long CloudFront caches the error before retrying.

4 min

read

8

sources

Nov 1, 2026

updated

Scaplet Editorial Team

author

In one line

CloudFront returns a 404 when the requested object does not exist at the origin, the origin path is wrong, the origin itself sent a 404, or a custom error page is missing. CloudFront also caches error responses for 10 seconds by default, so a fixed object can still 404 briefly. Test the origin URL directly, then check origin path and error page settings.

30-second check

## Where does your site stand?

Four quick questions, then a straight answer.

1/4Have you checked your own site for this?

Summarize this page with [ChatGPT](https://chatgpt.com/?hints=search&q=Summarize%20https%3A%2F%2Fscaplet.com%2Ferrors%2Fcdn%2Fcloudfront-404%20(%22CloudFront%20404%20Not%20Found%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Claude](https://claude.ai/new?q=Summarize%20https%3A%2F%2Fscaplet.com%2Ferrors%2Fcdn%2Fcloudfront-404%20(%22CloudFront%20404%20Not%20Found%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Perplexity](https://www.perplexity.ai/search?q=Summarize%20https%3A%2F%2Fscaplet.com%2Ferrors%2Fcdn%2Fcloudfront-404%20(%22CloudFront%20404%20Not%20Found%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [![Google](/logos/ai/google-color.svg)AI Mode](https://www.google.com/search?udm=50&q=Summarize%20https%3A%2F%2Fscaplet.com%2Ferrors%2Fcdn%2Fcloudfront-404%20(%22CloudFront%20404%20Not%20Found%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.)

On this page

## 5 parts, 4 minutes.

1. [The five documented causes 01](#the-five-documented-causes)
2. [Origin path and default root object 02](#origin-path-and-default-root-object)
3. [Why the 404 sticks after you fix it 03](#why-the-404-sticks-after-you-fix-it)
4. [Reproduce and verify 04](#reproduce-and-verify)
5. [SEO and crawler notes 05](#seo-and-crawler-notes)

_01_CloudFront 404 causes

## The five documented causes

AWS says CloudFront returns a 404 "when the client attempts to access a resource that doesn't exist". Its troubleshooting page lists the common causes, which this table maps to a check and a fix.

Cause

### Resource does not exist or URL is wrong

How to check

Request the same path on the origin directly

Fix

Upload the object or correct the link

Cause

### Custom origin returns the 404

How to check

Origin access log shows the 404 for that path

Fix

Fix the origin route; CloudFront passes the status on

Cause

### Custom error page returns 404

How to check

The distribution maps another error code to a page that is missing

Fix

Restore the error page object

Cause

### Custom error page was deleted

How to check

A 5xx now shows as 404

Fix

Re-upload the page at the configured path

Cause

### Incorrect origin path

How to check

Origin path value on the origin

Fix

Remember it is appended to every request path

**Any error can become a 404**AWS notes that with custom error pages configured, "Any error code might be translated to 404". If your origin returns a 500 and the error page object is missing, the viewer gets a 404 from CloudFront.

_02_Check it

## Origin path and default root object

If the origin path is populated, its value is appended to the path of each request before CloudFront forwards it. A request for `/index.html` with origin path `/site` fetches `/site/index.html` from the origin. A wrong value there is a classic cause of a 404 on every URL.

The default root object applies only to the root URL. With `index.html` as the default root object, a request for `/install/` is not rewritten to `/install/index.html`, even if that file exists. CloudFront's docs contrast this with S3 website index documents, which are returned for subdirectories. The string cannot start with a slash, since `/index.html` "can lead to a 403 Access Denied error".

CloudFront Function (viewer request) that appends index.html, from the AWS examples

```
async function handler(event) { var request = event.request; var uri = request.uri; // Check whether the URI is missing a file name. if (uri.endsWith('/')) { request.uri += 'index.html'; } // Check whether the URI is missing a file extension. else if (!uri.includes('.')) { request.uri += '/index.html'; } return request; }
```

_03_Error caching rules from the docs

## Why the 404 sticks after you fix it

CloudFront caches error responses for a default duration of 10 seconds, controlled by the Error Caching Minimum TTL per [status code](/glossary/http-status-codes). After that it asks the origin again. If the origin adds `Cache-Control: max-age` or `s-maxage`, CloudFront caches the error for the greater of the header value and the minimum TTL. For 404, 410, 414 and 501 it will not cache when the origin sends `no-store`, `no-cache` or `private`.

Setting

### Error caching minimum TTL

Behavior

10 seconds by default, set per status code

Setting

### Origin sends `Cache-Control: max-age` or `s-maxage`

Behavior

Greater of the header and the minimum TTL, capped by the behavior's Maximum TTL

Setting

### `no-store`, `no-cache`, `private` on 404, 410, 414, 501

Behavior

Error response is not cached

Setting

### S3 origin with a minimum TTL of 0

Behavior

Still 1 second for S3 origin errors

If a cached 404 lasts longer than you want and the object is back, invalidate the URL of the requested object. Invalidate each object separately when many return errors.

_04_How it works

## Reproduce and verify

1. 1

### Test the origin directly

Request the same path on the origin host. A 404 there means CloudFront is only passing it on.
2. 2

### Request through CloudFront

`curl -sI https://d111111abcdef8.cloudfront.net/path` and compare status and headers with the origin.
3. 3

### Review error pages

In the distribution's custom error pages and response codes, check the page path for each code and the response code CloudFront returns.
4. 4

### Check logs

With standard logs, the `sc-status` column holds the status sent to the viewer, while `x-edge-result-type` holds the result type from the origin. If you changed the response code, `sc-status` shows your value and `x-edge-result-type` can still read `Error`.

Compare origin and CloudFront

```
curl -sI https://origin.example.com/path | head -n 1 curl -sI https://d111111abcdef8.cloudfront.net/path | head -n 1
```

_05_Explained

## SEO and crawler notes

[Googlebot](/ai-crawlers/googlebot) sees the status CloudFront sends. Google drops 4xx URLs from the index over time, so a transient 404 from a bad deploy matters less than a persistent one. Do not use CloudFront's option to return 200 with an error page for missing content: Google would see a [soft 404](/glossary/soft-404). See [404 Not Found](/errors/http/404) for crawl behavior.

Questions

## Asked a lot.

3 questions people ask next, answered from the sources on this page.

_01_ Why does CloudFront return 404 for a file that exists in S3?

Check the origin path, which is appended to every request, and the exact object key. A default root object also only applies to the root URL, not subdirectories.

_02_ How long does CloudFront cache a 404?

10 seconds by default, per the Error Caching Minimum TTL, or longer if the origin sends max-age or s-maxage. Invalidate the URL if you need it cleared sooner.

_03_ Can CloudFront turn a 500 into a 404?

Yes. With custom error pages configured, AWS says any error code might be translated to 404, for example when the error page object has been deleted.

Sources · 8

## Every fact, linked and dated.

Official docs first. The date is when we last opened each page.

- amazon.com
- google.com

1. 01 [HTTP 404 status code (Not Found)](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/http-404-not-found.html) docs.aws.amazon.com · checked 2026-11-01
2. 02 [Generate custom error responses](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/GeneratingCustomErrorResponses.html) docs.aws.amazon.com · checked 2026-11-01
3. 03 [Control how long CloudFront caches errors](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/custom-error-pages-expiration.html) docs.aws.amazon.com · checked 2026-11-01
4. 04 [Change response codes returned by CloudFront](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/custom-error-pages-response-code.html) docs.aws.amazon.com · checked 2026-11-01
5. 05 [Specify a default root object](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/DefaultRootObject.html) docs.aws.amazon.com · checked 2026-11-01
6. 06 [Add index.html to request URLs without a file name](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/example-function-add-index.html) docs.aws.amazon.com · checked 2026-11-01
7. 07 [Invalidate files to remove content](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Invalidation.html) docs.aws.amazon.com · checked 2026-11-01
8. 08 [How HTTP status codes affect Google's crawlers](https://developers.google.com/crawling/docs/troubleshooting/http-status-codes) developers.google.com · checked 2026-11-01

## Keep learning

[All errors](/errors)

[Learn AWS Amplify 404 Not Found CDN and hosting errors](/errors/cdn/amplify-404) [Related 4xx errors Status codes and links](/seo-issues/4xx-errors) [Read next CloudFront 400: Bad Request CDN and hosting errors](/errors/cdn/cloudfront-400) [Do Run a free site audit Free, about two minutes](/site-audit)

Other 404 errors
[404 Not Found on nginx](/errors/http/404/nginx) [AWS Amplify 404 Not Found](/errors/cdn/amplify-404) [Cloudflare Pages 404 Not Found](/errors/cdn/cloudflare-pages-404) [Firebase Hosting 404](/errors/cdn/firebase-hosting-404) [GitHub Pages 404 Not Found](/errors/cdn/github-pages-404)

More Cloudfront errors
[CloudFront 400: Bad Request](/errors/cdn/cloudfront-400) [CloudFront 503: Service Unavailable](/errors/cdn/cloudfront-503)

More in CDN and hosting errors
[AWS 502 Bad Gateway](/errors/cdn/aws-502-bad-gateway) [AWS Amplify 404 Not Found](/errors/cdn/amplify-404) [AWS EC2: Connection timed out](/errors/cdn/aws-ec2-connection-timed-out) [AWS Lambda 502 Bad Gateway](/errors/cdn/aws-lambda-502) [AWS Lambda timeout](/errors/cdn/lambda-timeout) [Azure Front Door 502](/errors/cdn/azure-front-door-502) [Cloud Run 503 error](/errors/cdn/cloud-run-503) [Cloudflare 504 Gateway Timeout](/errors/cdn/cloudflare-504) [Cloudflare Pages 404 Not Found](/errors/cdn/cloudflare-pages-404) [Cloudflare too many redirects (ERR_TOO_MANY_REDIRECTS)](/errors/cdn/cloudflare-too-many-redirects) [Cloudflare verify you are human loop](/errors/cdn/cloudflare-verify-you-are-human-loop) [CloudFront 400: Bad Request](/errors/cdn/cloudfront-400) [CloudFront 404 Not Found](/errors/cdn/cloudfront-404) [CloudFront 503: Service Unavailable](/errors/cdn/cloudfront-503) [Firebase Hosting 404](/errors/cdn/firebase-hosting-404) [GitHub Pages 404 Not Found](/errors/cdn/github-pages-404) [Google Cloud 502 Bad Gateway](/errors/cdn/google-cloud-502) [Heroku 503 Service Unavailable](/errors/cdn/heroku-503) [Heroku H10: App crashed](/errors/cdn/heroku-h10-app-crashed) [Heroku H12: Request timeout](/errors/cdn/heroku-h12-request-timeout) [Heroku H13: Connection closed without response](/errors/cdn/heroku-h13) [Heroku H14: No web processes running](/errors/cdn/heroku-h14) [Netlify build failed](/errors/cdn/netlify-build-failed) [Netlify function timeout](/errors/cdn/netlify-function-timeout)

Terms on this page
[HTTP status codes](/glossary/http-status-codes) [Soft 404](/glossary/soft-404)

Free · 2 minutes

## Tools point. Agencies advise. _This one ships._

Run the free audit, then approve the fixes. Every change can be undone.

[Audit my site free](/site-audit)

Free, no card 60 seconds Nobody will call you

- **46** fixes shipped without a ticket Brightpipe
- **0→7** ChatGPT citations in six weeks Paylane
