Community Tip - Fixing Error 522: Connection timed out

CommunityTip

#1

Error
Try the suggestions in this Community Tip to help you fix Error 522.

Background
A 522 error happens when a TCP connection to the web server could not be established. This typically happens when Cloudflare requests to the origin (your webserver) get blocked. When this happens, you’ll see “Error 522: Connection timed out”.

Quick Fix Ideas

  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 whitelist the IP addresses here: https://www.cloudflare.com/ips. If the IPs that fail are consistent each time, that indicates some of the IPs in Cloudflare’s IP ranges are either being rate-limited or blocked by a network device at your hosting provider. Because Cloudflare operates as a reverse proxy the IP address your server will see is one of a limited number of Cloudflare IPs. In that sense, many actual visitors may all come from the same IP address, which can cause firewalls or security software that is not appropriately whitelisting the Cloudflare IP ranges to block this traffic as it may see it as excessive or malicious

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

  4. Please reach out to your hosting provider or site administrator to confirm if there are any load problems on your infrastructure.

  5. It may be there was a temporary problem on the path or at your origin preventing connections from completing. If they are no longer happening, here are two actions to take: a) Check with your hosting provider to see if they had any issues with packet loss or if your server was under load at the time the errors happened and b) Have your hosting provider or server administrator confirm that all Cloudflare IP ranges are fully whitelisted from any rate limits.

  6. If your firewall is configured to DROP packets rather than refuse connections, it will cause a 521; meaning an incorrectly configured firewall can actually masquerade as a connection timeout 522 error.

Lite Reading

Background Resources
Knowledge Base
YouTube

Research The Issue
Community
Google

If You Need More Help
This community of other Cloudflare users may be able to assist you, if not, login to Cloudflare and then contact Cloudflare Support. When you contact support, make sure to include as much of this information as possible: time stamped log files from your origin server, RayID, domain name, error messages, screen shots, and/or HAR file(s).

Expert Comments Appreciated
This Community Tip will remain open for input from Community experts and those familiar with this issue. We really appreciate comments that start with words like: “The three things I always try”, or “Do this first” or “In my experience”.

This is a Cloudflare Community Tip, to review past tips click here.


Error 522, Connection timed out
522 error every 2 clicks
Error 522: Connection
The Site is very slow after installing SSL certificate with Full (strict) mode
Problems with some files 522 Error
The website is not opening when "Always Use HTTPS" enabled
Website is not loading when cloudflare name server is used
Error 522 on Wordpress Multisite
Https://sitename.com only works sometimes, usually fails but other URLs with http & https loads fine
Cloudflare can't connect to my he.net tunnelbroker IPv6 server
Client met Error 522
Error 522 Unable to see one website only when connecting through specific ISP
Не работает сайт!
Help! I whitelisted all CF ips, still not able to pass error 522
Changing hosting IP address gives 522 error connection timeout
How can I configure ssl on odoo website? Is for free or I have to contract something?
Some Error 522
Cant connect to my domain
My site bug error 552
Error 522 on specific CDN
#2

#3

This topic was automatically closed after 7 days. New replies are no longer allowed.