Distribution Custom Error Response
A complex type that controls:
Whether CloudFront replaces HTTP status codes in the 4xx and 5xx range with custom error messages before returning the response to the viewer.
How long CloudFront caches HTTP status codes in the 4xx and 5xx range. For more information about custom error pages, see Customizing Error Responses in the Amazon CloudFront Developer Guide.
Properties
The minimum amount of time, in seconds, that you want CloudFront to cache the HTTP status code specified in `ErrorCode`
. When this time period has elapsed, CloudFront queries your origin to see whether the problem that caused the error has been resolved and the requested object is now available. For more information, see Customizing Error Responses in the Amazon CloudFront Developer Guide.
The HTTP status code that you want CloudFront to return to the viewer along with the custom error page. There are a variety of reasons that you might want CloudFront to return a status code different from the status code that your origin returned to CloudFront, for example:
The path to the custom error page that you want CloudFront to return to a viewer when your origin returns the HTTP status code specified by `ErrorCode`
, for example, `/4xx-errors/403-forbidden.html`
. If you want to store your objects and your custom error pages in different locations, your distribution must include a cache behavior for which the following is true: