AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.
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.
Namespace: Amazon.CloudFront.Model
Assembly: AWSSDK.CloudFront.dll
Version: 3.x.y.z
public class CustomErrorResponse
The CustomErrorResponse type exposes the following members
Name | Description | |
---|---|---|
CustomErrorResponse() |
Name | Type | Description | |
---|---|---|---|
ErrorCachingMinTTL | System.Int64 |
Gets and sets the property ErrorCachingMinTTL.
The minimum amount of time, in seconds, that you want CloudFront to cache the HTTP
status code specified in For more information, see Customizing Error Responses in the Amazon CloudFront Developer Guide. |
|
ErrorCode | System.Int32 |
Gets and sets the property ErrorCode. The HTTP status code for which you want to specify a custom error page and/or a caching duration. |
|
ResponseCode | System.String |
Gets and sets the property ResponseCode. 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:
If you specify a value for |
|
ResponsePagePath | System.String |
Gets and sets the property ResponsePagePath.
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
If you specify a value for We recommend that you store custom error pages in an Amazon S3 bucket. 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. |
.NET Core App:
Supported in: 3.1
.NET Standard:
Supported in: 2.0
.NET Framework:
Supported in: 4.5, 4.0, 3.5