Skip to content

Commit

Permalink
add access-control-allow-origin to CDN
Browse files Browse the repository at this point in the history
  • Loading branch information
kahlstrm committed Jan 23, 2024
1 parent 4b2c6ac commit 0ab5c76
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion modules/web/app/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ resource "azurerm_cdn_endpoint" "next-cdn-endpoint" {
querystring_caching_behaviour = "BypassCaching"
origin {
name = "tikweb-web-${terraform.workspace}"
host_name = azurerm_linux_web_app.web.default_hostname
host_name = local.fqdn

}
origin_host_header = local.fqdn
Expand All @@ -146,6 +146,11 @@ resource "azurerm_cdn_endpoint" "next-cdn-endpoint" {
"/_next/static/"
]
}
modify_response_header_action {
action = "Overwrite"
name = "Access-Control-Allow-Origin"
value = "https://${local.fqdn}"
}
cache_expiration_action {
behavior = "Override"
duration = "10.00:00:00"
Expand Down

0 comments on commit 0ab5c76

Please sign in to comment.