My website face 520 error

How to solve this 520 error in website?

A 520 error occurs when the connection started on the origin web server, but that the request was not completed. The most common reason why this would occur is that either a program, cron job, or resource is taking up more resources than it should causing the server not to be able to respond to all requests properly.

I think first stop is to see if you can find the 520 in your origin logs and if so if that helps to identify which process is causing the error.

Review the Quick Fix Ideas in this Community Tip for troubleshooting suggestions.

We’re also seeing random 520 errors on our health checks on two different apps deployed to Heroku (our staging app and production apps). Cloudflare traffic analytics shows the 520s to be Edge Status Codes. Our apps are performing just fine and have tons of headroom.

When we saw the error at 3am PDT today we also saw a complete absence of traffic hitting our front ends for 2 minutes except for two successful Cloudflare health check pings.

I’ll raise a support ticket if needed, but just wondered if there was something else going on and seeing someone else have the same errors is suspicious.

-Amanda, Enginerering @ Observable