Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
28 lines (15 sloc) 2.74 KB

Configuring Error Response Behavior

You can use either the CloudFront API or console to configure CloudFront error responses. For information about using the CloudFront API to configure error responses, go to PUT Distribution Config in the Amazon CloudFront API Reference, and see the CustomErrorResponses element.

To configure CloudFront error responses using the console

  1. Create the custom error pages that you want CloudFront to return to viewers when your origin returns HTTP 4xx or 5xx errors. Save the pages in a location that is accessible to CloudFront.

    We recommend that you store custom error pages in an Amazon S3 bucket even if you're using a custom origin. If you store custom error pages on an HTTP server and the server starts to return 5xx errors, CloudFront can't get the files that you want to return to viewers because the origin server is unavailable.

  2. Confirm that you have granted CloudFront at least read permission to your custom error page objects.

    For more information about Amazon S3 permissions, see Access Control in the Amazon Simple Storage Service Developer Guide. For information on using the Amazon S3 console to update permissions, go to the

  3. (Optional) Configure your origin server to add Cache-Control directives or an Expires header along with the error response for specific objects, if applicable. For more information, see Controlling How Long CloudFront Caches Errors.

  4. Sign in to the AWS Management Console and open the CloudFront console at

  5. In the list of distributions, select the distribution to update and choose Distribution Settings.

  6. Choose the Error Pages tab. Then either choose Create Custom Error Response, or choose an existing error code and choose Edit.
    [Select Web as the distribution type.]

  7. Enter the applicable values. For more information, see Custom Error Pages and Error Caching.

  8. If you configured CloudFront to return custom error pages, add or update the applicable cache behaviors. For more information, see Storing Objects and Custom Error Pages in Different Locations.

  9. To save your changes, choose Yes, Edit.

You can’t perform that action at this time.