Skip to content

Commit 0a4aec8

Browse files
committed
enable cloudflare proxy to haxe.org
1 parent fef55f2 commit 0a4aec8

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

cloudflare.tf

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,28 @@ resource "cloudflare_ruleset" "cache_rules" {
2424
phase = "http_request_cache_settings"
2525

2626
rules = [
27+
{
28+
ref = "haxe-org-cache-rule"
29+
description = "Set cache settings for haxe.org"
30+
expression = "(http.host eq \"haxe.org\")"
31+
enabled = true
32+
action = "set_cache_settings"
33+
action_parameters = {
34+
cache = true
35+
edge_ttl = {
36+
mode = "respect_origin"
37+
status_code_ttl = [
38+
{
39+
status_code_range = {
40+
from = 200
41+
to = 399
42+
}
43+
value = 60 * 60 * 24 * 1 # 1 day
44+
}
45+
]
46+
}
47+
}
48+
},
2749
{
2850
ref = "api-haxe-org-cache-rule"
2951
description = "Set cache settings for api.haxe.org"
@@ -71,6 +93,7 @@ resource "cloudflare_dns_record" "haxe-org" {
7193
type = "CNAME"
7294
content = aws_cloudfront_distribution.haxe-org.domain_name
7395
ttl = 1
96+
proxied = true
7497
}
7598

7699
resource "cloudflare_dns_record" "haxe-org-MX" {

0 commit comments

Comments
 (0)