Netlify + Cloudflare proxy returning 521

I have a gatsby site hosted on Netlify and cloudflare proxy on top of it.
But it returns Error 521 - Web server is down error.
My assumption is that netlify is blocking cloudflare ips from accessing the site.

Any idea how to resolve it?

Edit: sometimes it times out even with proxy disabled

Hi there, glad you found us :wave: before we can help you, we need a little more information on the issues you are facing.

First, have you looked through this resource? It is a compilation of all of our build and deploy resources. This is a good starting point.

If you have worked through those guides and are still encountering issues please share the following information:

  • the name of your build instance: “example-jones.netlify.com
  • steps to reproduce the error
  • your most recent deploy log
  • any error messages you have received in your terminal window or in the developer console

Hi @hillary
I’m facing a similar issue. Deployment is fine. The app is running fine, but occasionally I get a 500 server error. Then you refresh and sometimes it goes away and sometimes stay for a bit.
I have configured Cloudflare as my dns and I’m also using their proxy for various favorable reasons in comparison with Netlify.
The site is: borgescafe.netlify.app
and below is the error screenshot

Your website appears to be working. How can we reproduce the issue?

Based on your logs: Function details | Functions | borgescafe | Netlify

It’s this: Server.edge not defined Error on nextJS SSR functions cause site to return 500 Errors