Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support SPA requests by routing 404 to /index.html #44

Merged
merged 1 commit into from
Dec 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions terraform/web.tf
Original file line number Diff line number Diff line change
Expand Up @@ -227,13 +227,8 @@ module "cdn" {
custom_error_response = [
{
error_code = 404
response_code = 404
response_page_path = "/errors/404.html"
},
{
error_code = 403
response_code = 403
response_page_path = "/errors/403.html"
response_code = 200
response_page_path = "/index.html"
},
]

Expand Down Expand Up @@ -264,6 +259,9 @@ module "cdn" {
compress = true
cache_policy_id = data.aws_cloudfront_cache_policy.Managed-CachingOptimized.id
use_forwarded_values = false

// See https://github.com/aws-samples/amazon-cloudfront-functions/tree/main/url-rewrite-single-page-apps
function_association = {}
}

ordered_cache_behavior = [
Expand Down
Loading