Skip to main content

CloudFrontCustomErrorResponseSchema

What the viewer gets when the origin answers with a status code CloudFront was told to handle.

The same field set expresses opposite intents. A single-page app maps 403 and 404 to a 200 carrying /index.html with a short TTL, so the client-side router can take over; a content site maps them to a real 404 carrying an error page.

@group

Resources/CloudFrontDistribution

Index

Properties

optionalerrorCachingMinTtl

errorCachingMinTtl?: number = 10

How long CloudFront caches this error before asking the origin again, in seconds.

errorCode

errorCode: number

The status code the origin answered with.

responseCode

responseCode: number

The status code the viewer sees.

responsePagePath

responsePagePath: string

The object served in place of the error, e.g. /index.html.