I receive <Code>AccessDenied</Code> error when I try to reach a resource on XDN project

My page has been setup as proxied requests to the upstream site

When I try to reach any recourse from this page, I receive the error:

<Message>Access Denied</Message>

Is problem on origin side or XDN side?

There was a similar error posted here: Receiving 404 "Access Denied" error on edge, but responds with 200 on serverless

See if that helps.

Hey Andrew,

Could you post the relevant bits of your router (are you using any of @xdn/ packages?) and the path to the resource? If there is any sensitive data please DM it to me.



I think I found what is going on here.

I have rule that sending everything with _next/static to XDN

  .match("/_next/static/:path*", ({ cache, serveStatic }) => {

But proxied page requests resources from the upstream.

In this particular case this error is XDN error that requested resource has not been found.

As first step check router’s rules, probably it references this static asset and sends everything to XDN instead of the upstream site.

1 Like

Ok, glad to hear you solved it. Also note that our @xdn/next package, if added through .use, will also insert a route for '/_next/static/:path*' pointing to the static backend. If you need to work around this, before .use rule add your own rule for '/_next/static/:path*' and route those requests to origin.

1 Like