Fix - Website Connection timed out Error Code 522 (Cloudflare)

Cloudflare - Connection timed out - Error code 522

At times, you might see the above message - "Connection timed out - Error 522" when you try to access a website using your computer or mobile phone's web browser like Safari, Chrome, Firefox, or others.

This error is related to the website server and there is nothing wrong on your side. As you may see, a green tick saying that your browser is working fine and so is the Cloudflare server (CDN) located near your city, but there is an issue with the Host.

Why Error 522?

    We get the Cloudfare Error 522, when the initial connection between Cloudflare's network and the origin web server (i.e. Website server) timed out thus the page you are trying to load is not displayed.

What should I do as an end user?

    You can try to refresh the page and try again in some time. If you are a part of the website organization, you can reach out to their IT Support team saying the page/app is unreachable with "Cloudflare Error Code 522"

    To help the Support team reach the root of the issue, you can share the "Cloudflare Ray ID" that you will see at the bottom of the error page.

What should I do as a Website Owner?

    As we discussed earlier, Error 522 is a connection timeout error that occurs when Cloudflare times out when trying to connect to your web server.

    The connection time out can occur when:

    1. Cloudflare sends a SYN message to your web (origin) server and does not get a SYN+ACK within 15 seconds
    2. The connection is established but the web server (origin) does not acknowledge (ACK) Cloudflare’s resource request within 90 seconds.

    How to Fix: Error 522

    The most common reason for this error could be:

      1) That your server is overloaded and unhealthy to handle any more requests at the moment.

      2) The web server is down and offline.

      3) The IP of the Webserver has changed, and there is a mismatch between what is configured with Cloudflare.

      4) It could be that the Cloudflare IPs are either rate-limited or have been blocked in .htaccess, iptables, or the server firewalls, make sure to whitelist them.

      5) Make sure that the keepalives are not disabled at the web (origin ) server.

      6) Check that there are no packets dropped at your web (origin) server.

    If nothing works, you will need to take a look at your web server - IIS, Apache, Nginx, or others which can be hosted with GoDaddy, HostGator, WordPress, or cloud services like AWS, Azure, or Google Cloud. If you are unable to see any issues, you need to reach out to them.

Hope you find this article useful, if you have any issues, feel free to add a comment, or if you have any other findings that will be helpful for other readers.

This is not an AI-generated article but is demonstrated by a human on an M1 Mac running macOS Sonoma 14.0.

Please support independent contributors like Code2care by donating a coffee.

Buy me a coffee!

Buy Code2care a Coffee!

Facing issues? Have Questions? Post them here! I am happy to answer!

Author Info:

Rakesh (He/Him) has over 14+ years of experience in Web and Application development. He is the author of insightful How-To articles for Code2care.

Follow him on: X

You can also reach out to him via e-mail:

Copyright Β© Code2care 2024 | Privacy Policy | About Us | Contact Us | Sitemap