Customizing error responses in CloudFront
The objects that you're serving through CloudFront can be unavailable for a variety of reasons. These reasons fall into two broad categories:
- Client errors (status code range 4xx): These errors are the result of HTTP requests sent by the client. For example, the object name isn't available, or the user doesn't have the permissions required to read the object.
- Server errors (status code range 5xx): These errors indicate a problem with the origin server as is not able to process the request. For example, the HTTP server is busy or unavailable.
Getting ready
The HTTP status codes for which CloudFront can return a custom error page includes the following:
- 400, 403, 404, 405, 414
- 500, 501, 502, 503, 504
How to do it...
- Log in to the
AWS Console
, selectCloudFront
, select your distribution, and go to theError Pages
tab. - Click on
Create Custom Error Response
.

CloudFront: Create Custom Error
- Set up the error pages and click on
Create
.

CloudFront: Create Custom Error...