Skip to content

SmooaiNextEdge: send origin Host to ALB by default (0.1.5)#4

Merged
brentrager merged 1 commit into
mainfrom
stage-c-origin-host
Jun 11, 2026
Merged

SmooaiNextEdge: send origin Host to ALB by default (0.1.5)#4
brentrager merged 1 commit into
mainfrom
stage-c-origin-host

Conversation

@brentrager

Copy link
Copy Markdown
Contributor

Problem (Stage C Phase 1 dogfood #2)

SmooaiNextEdge forwarded the viewer Host to the origin (allViewerAndWhitelistCloudFront). But the canonical origin — an EKS ALB Ingress — routes by a fixed origin host (host: web-origin.example.com). So CloudFront sent Host: web-next.smoo.ai, matched no Ingress rule, and the ALB returned 404 (server: awselb/2.0). The live apex only works because sst.aws.Router rewrites Host to the origin.

Fix

Default the dynamic (default) behavior to the AWS-managed Managed-AllViewerExceptHostHeader origin-request policy — forwards all cookies/auth headers/query strings but not Host, so CloudFront sends the origin's own host and the ALB routes to the pods. Add forwardViewerHost?: boolean (default false) to opt back into viewer-host forwarding for host-agnostic origins.

This also fixes the identical 404 the Phase 2 apex swap would have hit (apex smoo.ai → same ALB).

Bumps @smooai/deploy0.1.5.

Test

pnpm sst install && pnpm typecheck green (PR-checks constructs gate). Validated end-to-end by smooai web-next.smoo.ai after redeploy.

🤖 Generated with Claude Code

…(0.1.5)

Stage C Phase 1 dogfood #2: the construct forwarded the VIEWER Host
(allViewerAndWhitelistCloudFront) to the origin, but an EKS ALB Ingress routes
by a fixed origin host (`host: web-origin.example.com`). So CloudFront sent
`Host: web-next.smoo.ai`, matched no Ingress rule, and the ALB returned 404.
(The live apex works only because sst.aws.Router rewrites Host to the origin.)

Default the dynamic behavior to the AWS-managed `Managed-AllViewerExceptHostHeader`
policy — forwards all cookies/auth/qs but NOT Host, so CloudFront sends the
origin's host and the ALB routes correctly. Add `forwardViewerHost?: boolean`
(default false) to opt back into viewer-host forwarding for host-agnostic
origins. Also fixes the same 404 the Phase 2 apex swap would have hit.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Jun 11, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 1f80fd5

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@brentrager brentrager merged commit c910e97 into main Jun 11, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant