# Netlify + Cloudflare proxy returning 521

**URL:** <https://answers.netlify.com/t/netlify-cloudflare-proxy-returning-521/72729>\
**Category:** Support\
**Tags:** proxying, deployment\
**Created:** [August 5, 2022, 8:23am UTC](https://answers.netlify.com/t/netlify-cloudflare-proxy-returning-521/72729 "2022-08-05T08:23:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dev-catalyst](https://avatars.discourse-cdn.com/v4/letter/d/b19c9b/32.png) [@dev-catalyst](https://answers.netlify.com/u/dev-catalyst)\
**Post date:** [August 5, 2022, 8:23am UTC](https://answers.netlify.com/t/netlify-cloudflare-proxy-returning-521/72729/1 "2022-08-05T08:23:39Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![hillary](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/hillary/32/21132_2.png) [@hillary](https://answers.netlify.com/u/hillary)\
**Post date:** [August 5, 2022, 6:57pm UTC](https://answers.netlify.com/t/netlify-cloudflare-proxy-returning-521/72729/2 "2022-08-05T18:57:17Z")

</div>

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

First, have you looked through [this resource](https://answers.netlify.com/t/support-guide-compiled-build-and-deploy-resources-start-here/50679)? 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](http://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

---

<div class="post-metadata">

**Author:** ![Charly](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/charly/32/53901_2.png) [@Charly](https://answers.netlify.com/u/Charly)\
**Post date:** [August 23, 2023, 9:16am UTC](https://answers.netlify.com/t/netlify-cloudflare-proxy-returning-521/72729/3 "2023-08-23T09:16:12Z")

</div>

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](https://borgescafe.netlify.app/)  
and below is the error screenshot

 ![image](https://global.discourse-cdn.com/netlify/original/3X/9/8/982659adbbcf858ff11dccf98f6555728887338c.jpeg)

---

<div class="post-metadata">

**Author:** ![hrishikesh](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/hrishikesh/32/74607_2.png) [@hrishikesh](https://answers.netlify.com/u/hrishikesh)\
**Post date:** [August 23, 2023, 5:29pm UTC](https://answers.netlify.com/t/netlify-cloudflare-proxy-returning-521/72729/4 "2023-08-23T17:29:27Z")

</div>

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

Based on your logs: [Function details | Functions | borgescafe | Netlify](https://app.netlify.com/sites/borgescafe/functions/___netlify-handler)

 ![image](https://global.discourse-cdn.com/netlify/original/3X/6/7/67536135b457a9c203bd53a690ff678d1c4ace87.png)

It’s this: [Server.edge not defined Error on nextJS SSR functions cause site to return 500 Errors](https://answers.netlify.com/t/91793)
