Each federated docs section (IAM, KMS, Platform) builds unique layout
and page chunks that only exist on its CF Pages origin. The Worker was
routing all /_next/ requests to the main origin, causing 404s for
section-specific chunks (e.g. app/docs/layout-*.js), which crashed
client-side hydration and broke sidebar navigation.
Now the Worker checks the Referer header on /_next/ requests to
determine which section the browser is rendering, and routes to that
section's origin first, falling back to main if the asset is missing.