Skip to content

Commit

Permalink
CCL-497 added 404 custom_error_response (#167)
Browse files Browse the repository at this point in the history
  • Loading branch information
mynampatinaveen authored Sep 4, 2024
1 parent e0b3259 commit 916f178
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions modules/products/static-site/cloudfront.tf
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@ resource "aws_cloudfront_distribution" "static_site_distribution" {
event_type = "viewer-request"
function_arn = aws_cloudfront_function.rewritedefaultindexrequest.arn
}

custom_error_response {
error_code = 404
response_page_path = "/404.html" # Path to your custom error page
response_code = 404
error_caching_min_ttl = 10 # Cache TTL in seconds
}

}

restrictions {
Expand Down

0 comments on commit 916f178

Please sign in to comment.