Web app redirect to api sometimes falling through

I have a Redwood App (3 if you include other environments) deployed to Render. The project is comprised of a Static Site which redirects <APP_URL>/.redwood/functions/graphql/* to <API_URL> as an API proxy, and another rule redirecting <APP_URL>/* to /index.html to serve the static site.

Occasionally, a request to /graphql returns a 502 Gateway Error, with the response including the index.html file, leading me to believe this request wasn’t caught and proxied to the API. This happens somewhat sporadically, but at least every 2 minutes of continued use.

Is there a way for me to access CDN logs through Render, or if you had any advice on debugging the root cause of the issue? I don’t feel I have enough insight and control into the systems at play, unless I’m missing something.

I know Render hosts static sides behind Cloudfront US (even if EU based), and am considering removing the redirect so api requests go directly to the API rather than proxied through the web url.

I’ve decided to remove the re-write rule and route API requests directly to the backend URL.

Still keen on learning more about what the issue might be as I’d prefer not to deal with CORS if possible.

Hi there,

I believe this incident would have caused the 502 errors: https://status.render.com/incidents/0cmg9wb0kdfq.

That being said, I recommend leaving the calls directly to your backend from your frontend. Just one less piece of your application can break.

Note we use Cloudflare in front of our services, not Cloudfront.

Regards,

Keith
Render Support, UTC+10 :australia:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.