From 3a664af2748fa5217a08b18642024289fcab8aa4 Mon Sep 17 00:00:00 2001 From: OMPRAKASH MISHRA Date: Sat, 28 Jun 2025 15:43:56 -0700 Subject: [PATCH] fix: frontend spa routing --- infrastructure/modules/cloudfront/main.tf | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/infrastructure/modules/cloudfront/main.tf b/infrastructure/modules/cloudfront/main.tf index 8c68e960..4277932b 100644 --- a/infrastructure/modules/cloudfront/main.tf +++ b/infrastructure/modules/cloudfront/main.tf @@ -82,6 +82,14 @@ resource "aws_cloudfront_distribution" "this" { ssl_support_method = var.acm_certificate_arn != null ? var.ssl_support_method : null minimum_protocol_version = var.acm_certificate_arn != null ? var.minimum_protocol_version : null } + dynamic "custom_error_response" { + for_each = var.distribution_type == "s3" ? [1] : [] + content { + error_code = 403 + response_code = 200 + response_page_path = "/" + } + } tags = var.tags }