Skip to content

Commit

Permalink
[OSDEV-899] Move React application to the S3 bucket
Browse files Browse the repository at this point in the history
  • Loading branch information
roninzp committed Dec 13, 2024
1 parent 0a7a8de commit 149d104
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions deployment/terraform/cdn.tf
Original file line number Diff line number Diff line change
Expand Up @@ -133,18 +133,24 @@ resource "aws_cloudfront_distribution" "cdn" {

ordered_cache_behavior {
path_pattern = "tile/*"
allowed_methods = ["GET", "HEAD", "OPTIONS"]
cached_methods = ["GET", "HEAD", "OPTIONS"]
allowed_methods = ["GET", "HEAD", "OPTIONS"]
cached_methods = ["GET", "HEAD", "OPTIONS"]
target_origin_id = "originAlb"

forwarded_values {
query_string = true
headers = ["Referer"] # To discourage hotlinking to cached tiles
headers = ["Referer"] # To discourage hotlinking to cached tiles

cookies {
forward = "none"
}
}
compress = true
viewer_protocol_policy = "redirect-to-https"
min_ttl = 0
default_ttl = 3600
max_ttl = 31536000 # 1 year. Same as TILE_CACHE_MAX_AGE_IN_SECONDS in src/django/oar/settings.py
}

ordered_cache_behavior {
path_pattern = "api/*"
Expand Down

0 comments on commit 149d104

Please sign in to comment.