problem with next.js page and api routes behind cloudflare access
Hi, I have multiple applications behind Cloudflare Access. These are next.js apps that use api routes to reach multiple backends. The apps themselves run on CF Pages. The (sub)domains are put behind CF Access and the api routes are all on the same domain as the site that calls them. For months now all the sites have worked perfectly for me. From about a week or two ago, while nothing was changed from my part (neither in the nextjs code nor in any of the the Cloudflare dashboards) suddenly these api routes are not available by the page. I tried to debug the issue and it looks to me that the request reaches the Cloudflare Access login page. The request is run from a page that is behind Access and I am already logged in. The weird thing to me is that sometimes the request goes though (like 1 out of 10 cases) and I get the data from my database for example. Does someome have an idea what could be the problem be here? I have tried deleting cookies, signing in again, removing and readding the subdomain to CF Access, tried on multiple devices.
0 Replies