Cloudflare error 520

Hello! We faced the problem with our website and Instagram application. When we going to the site from the Instagram application on the iPhone, we record error 520. This error occurs precisely when we trying to open the site through the integrated browser in Instagram application. The link from Instagram is Olga Larnaudie ( • Instagram photos and videos
In the other browsers, like Chrome of Safary, the link opens without errors. There are no any errors in the logs on the site server. When we disable Cloudflare, the error goes away. We think the error is being caused on the Cloudflare server. We welcome your help in this problem.

Hi there,

The link from Instagram doesn’t lead to but rather to, and it’s loading fine from my end:

If the problem persists, please try linking your page directly or contact the owner of

Take care.

There are 2 links in Instagram, try to follow the second one.

Hi there,

Seems to be opening fine:

Screenshot 2024-06-06 at 16.04.05

Do note that I’m not actually browsing from an iPhone, and perhaps most importantly I’m not browsing from Instagram browser.
I’m guessing this can be one of 3 things:

  • Incompatibility with the browser
  • Apple private relay interference
  • WAF somehow blocking some of the requests in the same session resulting in unexpected response from origin.

I would start by making sure private relay is disabled and test again, if that does not solve it, check you WAF events under Security > Events and see if something is being blocked.

  • As I was writing this I checked your events and I do see a user agent Java/1.8.0_265 being blocked due to integrity check, maybe to test, try adding that client IP from the request to a WAF allow rule just to check if that might be the issue. If it is, you can then create a more targeted rule.

Ultimately, if none of this works, try copying the link from the post and pasting it in the phone browser and see if it opens, if it does, it might be a browser incompatibility.

Take care.

The link opens in another browser. Browser incompatibility with Cloudflare?

  • Can you make sure that Cloudflare doesn’t block visitors from Instagram?

Hi there,

If the issue is caused by any kind of block at Cloudflare, it will/would show in your security events. I don’t think it’s the case though.
Going through our logs from the last 24h, I can see a few 520 and 522, these are the biggest % of occurrences logged on our end:
32.3%: "message": " context: Fail to connect to re.da.ct.ed:80 cause: Connection timed out (os error 110)",
28%: "message": " context: while writing body cause: Broken pipe (os error 32)",
17.4: "message": " context: during HTTP idle state cause: Connection reset by peer (os error 104)",
14.3: "message": " context: while reading response headers",

So by a little margin, most errors are a failed connection to origin, this might be caused by the origin actually being unresponsive, under heavy load, or some of Cloudflare IPs being rate limited or blocked at the origin.
To overcome this, please consider configuring you origin server to allow Cloudflare IPs:

This might also explain the second and third higher occurrences.

On a side note, one thing you should also consider is setting your SSL/TLS encryption mode to Full strict instead of Flexible, to accomplish this, you can generate an origin certificate in the dashboard under SSL/TLS > Origin Server and install it at your origin, after which you can safely up the encryption mode.

Take care.