infra: route bare /guides path to the guides origin#19449
Conversation
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 <noreply@anthropic.com>
Pre-merge Review — Last updated 2026-05-31T15:07:20ZTip Summary: Infra fix that changes the CloudFront ordered-cache-behavior Review confidence:
Investigation log
🔍 Verification trailNo verifiable claims extracted from this diff. 🚨 Outstanding in this PRNo outstanding findings in this PR.
|
|
Your site preview for commit 6c8994c is ready! 🎉 http://www-testing-pulumi-docs-origin-pr-19449-6c8994c6.s3-website.us-west-2.amazonaws.com |
Human Chris here: See https://github.com/pulumi/guides/pull/123 for context.
What
Change the guides CloudFront cache behavior
pathPatternfrom/guides/*to/guides*(no slash) ininfrastructure/index.ts.Why
https://www.pulumi.com/guides(no trailing slash) currently returns 404, while/guides/and every nested path work fine. Reported in pulumi/guides#82.The cause is purely a routing pattern. The guides behavior matches
/guides/*, which does not match the bare/guides. So that request never reaches the guides origin — it falls through to the docs default origin and 404s. Confirmed against production via thevia:CloudFront hop count:Registry already gets this right with
/registry*(no slash), and the bare/registry302-redirects correctly today:This change makes guides match registry. Once the bare path routes to the guides origin, the S3 website endpoint behind that distribution issues the trailing-slash 302 natively — no per-directory redirect objects or placeholder pages needed.
Impact
/guideswill 302-redirect to/guides/instead of 404ing. Like/registry*, the no-slash glob also matches sibling prefixes (e.g./guides-foo), which is consistent with the registry precedent; there are no other/guides-prefixed docs paths today.Fixes pulumi/guides#82.
🤖 Generated with Claude Code