Repository navigation
feat(proxy): add proxy.origin for a separate client-facing proxy origin - #973
Conversation
`proxy.origin` resolves the client proxy prefix against another host, so the intercept plugin, bundle rewrites, auto-injected endpoints, the GA proxy endpoint and Partytown `resolveUrl` emit `https://<origin>/_scripts/p/...`. The server route, server proxy config, bundled assets and devtools keep the relative prefix. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@felixgabler is attempting to deploy a commit to the Nuxt Team on Vercel. A member of the Team first needs to authorize it. |
commit: |
|
No actionable comments were generated in the recent review.
|
📦 Package Size📚 22 runtime dependencies (no change)
All tracked output (25)
Runtime dependencies (22)
Baseline: main_@_321e7574___2026-10-13 · gzip is the comparison metric · changes below 16 B gzip are ignored |
🤖 MERGED
GitHub merged this pull request.
60df4be9-2b1b-424e-a6f0-ed6c558d57a2 Selected findings run after merge and open separate pull requests. |
|
Awesome work, thanks 🙌 |
Fixes #972
The first-party proxy builds every client-facing URL from
location.origin: the intercept plugin, bundle rewrites (self.location.origin+...) and the GAproxyEndpoints. The proxy therefore cannot live on another host, for example a tracking subdomain that points at the same deployment.This adds an optional
proxy.origin. When it is set, the module resolves a client prefixnew URL(proxyPrefix, origin).hrefand hands it to every client-facing consumer. AST rewrites drop theself.location.origin+prefix when the rewrite target is already absolute. The intercept plugin builds proxied URLs withnew URL(..., location.origin)and leaves URLs that already point at the proxy unchanged.The server handler route, the server-side proxy config, bundled assets and devtools keep the relative prefix, so nothing changes when
originis unset.proxyUrloriginwhen set)applyAutoInject)proxyEndpoints.googleAnalyticsresolveUrl<prefix>/p/**runtimeConfig['nuxt-scripts-proxy'].proxyPrefixbuildAssetUrl)Tests: AST rewrite cases for absolute and relative targets, intercept
proxyUrlruntime cases, and theproxy-aliasfixture now setsoriginto assert the absolute GA and Plausible endpoints while the relative server route still answers.