I have an Error HTTP code 522

Hello,
I have some errors on my site a 522 error. I already discuss with my hosting people there was no problem. So I want to ask the Cloudflare community how to resolve this error. My site is based on Cloudflare.

what is your domain?

My domain wealthywork.in

I don’t get an error, your site loads for me!

Troubleshooting

Error 522: connection timed out

Error 522 occurs when Cloudflare times out contacting the origin web server. Two different timeouts cause HTTP error 522 depending on when they occur between Cloudflare and the origin web server:

  1. Before a connection is established, the origin web server does not return a SYN+ACK to Cloudflare within 15 seconds of Cloudflare sending a SYN.
  2. After a connection is established, the origin web server doesn’t acknowledge (ACK) Cloudflare’s resource request within 90 seconds.

An HTTP 524 error occurs if the origin web server acknowledges ( ACK ) the resource request after the connection has been established, but does not send a timely response.

Resolution

Contact your hosting provider to check the following common causes at your origin web server:

  • (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.

If you are using Cloudflare Pages, verify that you have a custom domain set up and that your CNAME record is pointed to your custom Pages domain. Instructions on how to set up a custom Pages domain can be found here.

If none of the above leads to a resolution, request the following information from your hosting provider or site administrator before contacting Cloudflare support:

  • An MTR or traceroute from your origin web server to a Cloudflare IP address that most commonly connected to your origin web server before the issue occurred. Identify a connecting Cloudflare IP recorded in the origin web server logs.
  • Details from the hosting provider’s investigation such as pertinent logs or conversations with the hosting provider.

When I audit using ahrefs, it’s showing this.

Did you follow the troubleshooting steps I provided?

Yes, I already did that

All of it?

My hosting provider said everything is working fine from there. He said to check with Cloudflare support or ahrefs support.

Hello!

A 522 error happens when a TCP connection to the web server could not be established. This typically happens when our requests to the origin (your webserver) get blocked.

Here is what I recommend in order to ensure all requests from Cloudflare are accepted by your server:

  1. Make sure that you’re not blocking Cloudflare IPs in .htaccess, iptables, or your firewall.
  2. Make sure your hosting provider isn’t rate limiting or blocking IP requests from the Cloudflare IPs and ask them to allowlist the IP addresses here: https://www.cloudflare.com/ips.
  3. Make sure the selected SSL option in the Overview tab of the Cloudflare SSL/TLS app is compatible with your hosting service configuration - What do the SSL options mean?

If you are seeing 522 errors in certain locations only, it means you likely forgot to allowlist one of our ranges that corresponds to these locations, so double check to ensure all our IPs are allowlisted appropriately.

Hope this helps!

1 Like