responseCode property
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:
-
Some Internet devices (some firewalls and corporate proxies, for example)
intercept HTTP 4xx and 5xx and prevent the response from being returned to
the viewer. If you substitute
200, the response typically won't be intercepted. -
If you don't care about distinguishing among different client errors or
server errors, you can specify
400or500as theResponseCodefor all 4xx or 5xx errors. -
You might want to return a
200status code (OK) and static website so your customers don't know that your website is down.
ResponseCode, you must also specify
a value for ResponsePagePath. If you don't want to specify a
value, include an empty element, <ResponseCode>, in the
XML document.
Implementation
final String? responseCode;