I am running into this issue, where the Access-Control-Allow-Origin header is missing from the /_vercel/insights/view endpoint when reverse proxying (so it works when I am on the request URL directly but not when there's a referrer url. I have added the headers to the vercel.json, the next.config.js, the middleware that handles it, and even tried on the proxy's side via Cloudflare. Hoping to get some help in solving this, and share as much context as I can
Then in Cloudflare, I tried from the org doing to proxy to set the headers following their docs, with no such luck.
In the browser, we see a CORs error with a missing header, and I do see it's missing but can't seem to add it with any of the above
I suspect there's some issue either with how we have Vercel Analytics implemented, or NextJS is stripping the header at some point, but have hit a bit of a wall and could use new eyes. Thanks in advance for any help!
I am running into this issue, where the
Access-Control-Allow-Origin
header is missing from the/_vercel/insights/view
endpoint when reverse proxying (so it works when I am on the request URL directly but not when there's a referrer url. I have added the headers to thevercel.json
, thenext.config.js
, the middleware that handles it, and even tried on the proxy's side via Cloudflare. Hoping to get some help in solving this, and share as much context as I canThe
vercel.json
file:The
next.config.js
The middleware
How we set analytics:
Then in Cloudflare, I tried from the org doing to proxy to set the headers following their docs, with no such luck.
In the browser, we see a CORs error with a missing header, and I do see it's missing but can't seem to add it with any of the above
I suspect there's some issue either with how we have Vercel Analytics implemented, or NextJS is stripping the header at some point, but have hit a bit of a wall and could use new eyes. Thanks in advance for any help!