{"id":1386,"date":"2020-06-06T20:26:06","date_gmt":"2020-06-06T12:26:06","guid":{"rendered":"https:\/\/www.wesbytes.com\/guide\/?post_type=kb&#038;p=1386"},"modified":"2026-01-12T15:06:12","modified_gmt":"2026-01-12T07:06:12","slug":"error-522-connection-timed-out","status":"publish","type":"kb","link":"https:\/\/www.servergigabit.com\/guide\/kb\/error-522-connection-timed-out","title":{"rendered":"Error 522: Connection timed out"},"content":{"rendered":"<div class=\"mkb-anchor mkb-clearfix mkb-back-to-top-inline\">\n<h2 class=\"mkb-anchor__title\">Overview<\/h2>\n<p><span style=\"font-size: 16px;\">Error 522 indicates that Cloudflare is unable to reach the origin web server and the request times out.\u00a0<\/span><\/p>\n<p><img fetchpriority=\"high\" decoding=\"async\" class=\"alignnone\" src=\"https:\/\/global.discourse-cdn.com\/cloudflare\/original\/3X\/5\/7\/57a39bdb1b4323a70780f9eeab9d77e530b7cba5.png\" alt=\"Error 522 \" width=\"625\" height=\"471\" \/>As a first step in troubleshooting Error 522:<\/p>\n<ul>\n<li>Check that the origin web server is active and accepting HTTP requests.<\/li>\n<li>Verify that the DNS settings in your Cloudflare account are correct.<\/li>\n<\/ul>\n<hr \/>\n<div class=\"mkb-anchor mkb-clearfix mkb-back-to-top-inline\">\n<h2 class=\"mkb-anchor__title\">Common Causes<\/h2>\n<\/div>\n<p>Several conditions may cause Error 522 to appear. The most common causes include:<\/p>\n<ul>\n<li>Overloaded web server<\/li>\n<li>Blocked Cloudflare requests<\/li>\n<li>Faulty network routing<\/li>\n<li>Disabled keepalives<\/li>\n<\/ul>\n<p>Other possible causes may also include:<\/p>\n<ul>\n<li>Incorrect IP address in the Cloudflare DNS settings (i.e. the request from us was sent to the wrong place)<\/li>\n<li>Offline origin web server<\/li>\n<li>Dropped packets on the host network<\/li>\n<\/ul>\n<p>Below, you will find additional information for the most common causes.<\/p>\n<\/div>\n<div class=\"mkb-anchor mkb-clearfix mkb-back-to-top-inline\">\n<h3 class=\"mkb-anchor__title\"><strong>Overloaded origin web server<\/strong><\/h3>\n<\/div>\n<p>A server could be dropping requests as a result of an overload condition.\u00a0What constitutes a high load can differ depending on the server\u2019s hardware and software.<\/p>\n<p>Generally, a load average of over 10-20 could mean that the server is overloaded. To check for this on Linux\/Unix, you can run the\u00a0<strong>w<\/strong>\u00a0or\u00a0<strong>top<\/strong>\u00a0commands in the terminal window.<\/p>\n<p>If you\u2019re unable to verify web server load on your own, check with your host or a system administrator.<\/p>\n<div class=\"mkb-anchor mkb-clearfix mkb-back-to-top-inline\">\n<h3 class=\"mkb-anchor__title\"><strong>Blocked Cloudflare requests<\/strong><\/h3>\n<\/div>\n<p>Blocking Cloudflare requests is the most common cause of intermittent 522 errors.<\/p>\n<p>When traffic flows through a Cloudflare-enabled website, the origin web server sees all requests as coming from a handful of Cloudflare IP addresses. This can often trigger firewalls and IP rate-limiters to block Cloudflare requests, thinking that the website is under attack.\u00a0<strong>CPHulk<\/strong>\u00a0(which comes with\u00a0<strong>cPanel<\/strong>) and other services have been known to do this.<\/p>\n<p>To avoid this situation, make sure that:<\/p>\n<ul>\n<li>Cloudflare IPs are not being blocked in .htaccess, iptables, or your firewall.<\/li>\n<li>Your hosting provider isn\u2019t rate limiting or blocking requests from Cloudflare IPs. Ask the host to whitelist the\u00a0<a href=\"https:\/\/www.cloudflare.com\/ips\" rel=\"nofollow noopener\" target=\"_blank\">Cloudflare IP addresses<\/a>\u00a0.<\/li>\n<\/ul>\n<p>In addition, your host provider might wish to disable the rate limiter.<\/p>\n<div class=\"mkb-anchor mkb-clearfix mkb-back-to-top-inline\">\n<h3 class=\"mkb-anchor__title\"><strong>Faulty network routing<\/strong><\/h3>\n<\/div>\n<p>Faulty network routing between Cloudflare and the origin web server is more difficult to troubleshoot than the other causes. Before checking for this, first rule out the other potential causes.<\/p>\n<p>If you believe network issues might be the cause, file a ticket with Cloudflare support. Useful information to provide in your ticket includes:<\/p>\n<ul>\n<li>Details about what you have checked so far<\/li>\n<li>An\u00a0MTR or traceroute\u00a0from your server to a Cloudflare IP address, preferably one of the IP addresses from which you have seen requests from Cloudflare in the past<\/li>\n<\/ul>\n<div class=\"mkb-anchor mkb-clearfix mkb-back-to-top-inline\">\n<h3 class=\"mkb-anchor__title\"><strong>Disabled keepalives<\/strong><\/h3>\n<\/div>\n<p>Cloudflare uses\u00a0the Keep-Alive header\u00a0to improve performance. Disabling it in the origin web server causes connections to fail and return a 522 error in some circumstances. This feature is enabled by default in most major web servers, so unless you\u2019ve explicitly disabled it, this shouldn\u2019t be an issue.<\/p>\n<hr \/>\n<div class=\"mkb-anchor mkb-clearfix mkb-back-to-top-inline\">\n<h2 class=\"mkb-anchor__title\">Understand how Error 522 is trigger<\/h2>\n<p><img decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/sitechecker.pro\/wp-content\/uploads\/2023\/08\/522-status-code.png\" alt=\"What is 522 Status Code \ud83d\udcd6 How to Fix Issue\" \/><\/p>\n<\/div>\n<p>When someone visits a Cloudflare-enabled website, a connection is establish between Cloudflare and the website\u2019s origin server. To establish a connection, TCP uses a three-way handshake.<\/p>\n<ol>\n<li>SYN: Cloudflare sends three SYN packets to the origin server.<\/li>\n<li>SYN+ACK: In response, the origin server replies with a SYN+ACK.<\/li>\n<li>ACK: Finally, Cloudflare sends an ACK back to the origin server.<\/li>\n<\/ol>\n<p>At this point, both Cloudflare and the origin server have receive an acknowledgement of the connection, and communication is establish. If the origin server does not send a SYN+ACK back to Cloudflare within 15 seconds, a 522 error will occur and the connection is close.<\/p>\n<p>This diagram illustrates a successful TCP handshake:<\/p>\n<div class=\"mkb-anchor mkb-clearfix mkb-back-to-top-inline\">\n<p>The next diagrams shows that the SYN+ACK is not return from the origin web server within 15 seconds, triggering the Error 522 timeout:<\/p>\n<p>The next diagrams shows that the SYN+ACK is not return from the origin web server within 15 seconds, triggering the Error 522 timeout:<\/p>\n<p>Checking for these conditions with your server administrator or hosting provider is the best way to resolve these errors. If there is a network problem, a\u00a0traceroute\u00a0or MTR from the site origin is also useful.<\/p>\n<p>If you continue to see 522 errors after ruling out the aforementioned possibilities and troubleshooting the issue, contact Cloudflare Support for further investigation.<\/p>\n<\/div>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<div class=\"mkb-anchor mkb-clearfix mkb-back-to-top-inline\">\n<p>&nbsp;<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Overview Error 522 indicates that Cloudflare is unable to reach the origin web server and the request times out.\u00a0 As a first step in troubleshooting Error 522: Check that the origin web server is active and accepting HTTP requests. Verify that the DNS settings in your Cloudflare account are correct. Common Causes Several conditions may cause Error 522 to appear.&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"kbtopic":[43],"kbtag":[1501],"class_list":["post-1386","kb","type-kb","status-publish","hentry","kbtopic-cloudflare","kbtag-error-522"],"_links":{"self":[{"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kb\/1386","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kb"}],"about":[{"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/types\/kb"}],"author":[{"embeddable":true,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/comments?post=1386"}],"version-history":[{"count":3,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kb\/1386\/revisions"}],"predecessor-version":[{"id":6118,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kb\/1386\/revisions\/6118"}],"wp:attachment":[{"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/media?parent=1386"}],"wp:term":[{"taxonomy":"kbtopic","embeddable":true,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kbtopic?post=1386"},{"taxonomy":"kbtag","embeddable":true,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kbtag?post=1386"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}