From 249f03ca23310e5bf7bb9cfabbcf003446889d4a Mon Sep 17 00:00:00 2001 From: Gareth Faires <109661363+gfaires@users.noreply.github.com> Date: Mon, 20 Nov 2023 16:34:39 +0000 Subject: [PATCH] Add Custom error response to Cloudfront distribution to allow page refreshing --- aws/cloudformation-templates/base/cloudfront.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/cloudformation-templates/base/cloudfront.yaml b/aws/cloudformation-templates/base/cloudfront.yaml index 88f30605c..41ffdbf9a 100644 --- a/aws/cloudformation-templates/base/cloudfront.yaml +++ b/aws/cloudformation-templates/base/cloudfront.yaml @@ -106,6 +106,10 @@ Resources: DistributionConfig: Enabled: true Comment: !Sub 'Retail Demo Store CDN for ${WebUIBucket}' + CustomErrorResponses: + - ErrorCode: 403 + ResponseCode: 200 + ResponsePagePath: /index.html DefaultRootObject: index.html PriceClass: PriceClass_100 HttpVersion: http2and3