Skip to content

Commit 7233528

Browse files
committed
allow acme-challenges through to backends
1 parent 27fb52a commit 7233528

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

infra/cdn/main.tf

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,12 @@ resource "fastly_service_vcl" "python_org" {
124124
statement = "req.url ~ \"^/(api|admin)/\""
125125
type = "REQUEST"
126126
}
127+
condition {
128+
name = "Let's Encrypt"
129+
priority = 10
130+
statement = "req.url ~ \"^/.well-known/acme-challenge/\""
131+
type = "REQUEST"
132+
}
127133
condition {
128134
name = "apex redirect"
129135
priority = 10
@@ -133,7 +139,7 @@ resource "fastly_service_vcl" "python_org" {
133139
condition {
134140
name = "apex"
135141
priority = 1
136-
statement = "req.http.host == \"python.org\""
142+
statement = "req.http.host == \"python.org\" && req.url !~ \"^/.well-known/acme-challenge/\""
137143
type = "REQUEST"
138144
}
139145
condition {
@@ -350,6 +356,15 @@ resource "fastly_service_vcl" "python_org" {
350356
request_condition = "Uncacheable URLs"
351357
xff = "append"
352358
}
359+
request_setting {
360+
action = "pass"
361+
bypass_busy_wait = false
362+
force_ssl = false
363+
max_stale_age = 0
364+
name = "Let's Encrypt"
365+
request_condition = "Let's Encrypt"
366+
xff = "append"
367+
}
353368

354369
response_object {
355370
name = "www redirect"

0 commit comments

Comments
 (0)