Skip to content

Commit

Permalink
Create a cache behavior for statistics (#2028)
Browse files Browse the repository at this point in the history
  • Loading branch information
sukhpalp authored Jul 15, 2024
1 parent e3eb644 commit 9bd2b93
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions terraform/cloudfront.tf
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,18 @@ resource "aws_cloudfront_distribution" "wfnews_geofencing_nginx" {
response_headers_policy_id = aws_cloudfront_response_headers_policy.cache_control_response_headers.id
}

ordered_cache_behavior {
path_pattern = "/statistics"
allowed_methods = ["GET", "OPTIONS", "HEAD"]
cached_methods = ["GET", "HEAD"]
target_origin_id = "wfnews_nginx_${var.target_env}"
compress = true
viewer_protocol_policy = "redirect-to-https"
cache_policy_id = "658327ea-f89d-4fab-a63d-7e88639e58f6"

response_headers_policy_id = aws_cloudfront_response_headers_policy.cache_control_response_headers.id
}

ordered_cache_behavior {
path_pattern = "/static/*"
allowed_methods = ["GET", "HEAD"]
Expand Down Expand Up @@ -572,6 +584,18 @@ resource "aws_cloudfront_distribution" "wfnews_geofencing_gov_api" {
cache_policy_id = "658327ea-f89d-4fab-a63d-7e88639e58f6"
}

ordered_cache_behavior {
path_pattern = "/statistics"
allowed_methods = ["GET", "OPTIONS", "HEAD"]
cached_methods = ["GET", "HEAD"]
target_origin_id = "wfnews_nginx_gov_${var.target_env}"
compress = true
viewer_protocol_policy = "redirect-to-https"
cache_policy_id = "658327ea-f89d-4fab-a63d-7e88639e58f6"

response_headers_policy_id = aws_cloudfront_response_headers_policy.cache_control_response_headers.id
}

ordered_cache_behavior {
path_pattern = "/static/*"
allowed_methods = ["GET", "HEAD"]
Expand Down

0 comments on commit 9bd2b93

Please sign in to comment.