From 6c8994c66e33edf5f45063560134b2b1bb412c9f Mon Sep 17 00:00:00 2001 From: Christian Nunciato Date: Sun, 31 May 2026 08:05:18 -0700 Subject: [PATCH] infra: route bare /guides path to the guides origin The guides CloudFront cache behavior used pathPattern "/guides/*", which matches /guides/... but not the bare /guides path. A request for https://www.pulumi.com/guides therefore never reached the guides origin and 404'd at the docs default origin (pulumi/guides#82), even though /guides/ and all nested paths worked. Change the pattern to "/guides*" (no slash) so the bare path routes to the guides origin and receives the native S3-website trailing-slash 302 to /guides/, exactly as registry already does with "/registry*". Co-Authored-By: Claude Opus 4.8 --- infrastructure/index.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/infrastructure/index.ts b/infrastructure/index.ts index a716e392771b..b6b0adab30ad 100644 --- a/infrastructure/index.ts +++ b/infrastructure/index.ts @@ -739,7 +739,10 @@ if (config.guidesStack) { { ...baseCacheBehavior, targetOriginId: guidesCDN, - pathPattern: "/guides/*", + // "/guides*" (no slash) matches /guides, /guides.md, and + // /guides/... so the bare path reaches the guides origin and gets + // the native trailing-slash redirect, matching registry's behavior. + pathPattern: "/guides*", cachePolicyId: thirtyMinuteCachePolicy.id, originRequestPolicyId: allViewerExceptHostHeaderId, },