Cloudflare returning 522 even though the server is available

Hello
Today, there were to cases when all my websites proxied through Cloudflare were returning the 522 error. The interesting thing is that I could still access the server via ssh and from within the server all the system were fully functional. I see there is an error in the NY datacenter on the status page, but it seems to me that it cannot be related to this one as the server is in Germany and the traffic was routed via Kiev.

Once it was caught by a customer and once by me and it just went back to normal in a few minutes.

Can anyone suggest what can I do in such situations and what could be the reason for this outage as it’s really frustrating to have this downtime in production?

Thanks in advance.

Hi @kilobyte2007

Sorry to hear you’re having these issues. A Cloudflare 522 Error indicates that the connection to your origin web server from Cloudflare is timing out.

These are the most common causes and what you should check:

  • (Most common cause) Cloudflare IP addresses are rate limited or blocked in .htaccess, iptables, or firewalls. Confirm your hosting provider allows Cloudflare IP addresses.
  • An overloaded or offline origin web server drops incoming requests.
  • Keepalives are disabled at the origin web server.
  • The origin IP address in your Cloudflare DNS app does not match the IP address currently provisioned to your origin web server by your hosting provider.
  • Packets were dropped at your origin web server.

There is a helpful guide about this here:

Hope that helps!

2 Likes