Skip to content
SazM Senior dev · Fixed price
Find a service
Where can I help?

Use arrow keys to browse, Enter to open, and Escape to close.

11 destinations

Client Login Get a fix →

Bug Fixing · 5 min read

Cloudflare Error 522 "Connection Timed Out": Affordable $99 Fix

Fix Cloudflare Error 522 connection timed out: blocked Cloudflare IPs, stale origin DNS, overloaded web server, wrong ports and keep-alive, with a $99 fixed-price option.

Summary

"Error 522: Connection timed out" is a Cloudflare error page. It means Cloudflare could reach its own edge but could not open or complete a connection to your origin server in time. Visitors see the Cloudflare page instead of your site, often intermittently, often only under load, and often right after a hosting move, a firewall change or a DNS edit.

This guide gives you the fast isolation steps first. If you would rather hand it over, SazM offers an affordable, low-cost Cloudflare 522 fix for a fixed $99 price, delivered within 48 hours, entirely in writing: no calls, no project manager, one senior developer.

Where the Error Lives

A 522 is not logged by your application, because the request never reaches it. Evidence lives at the network and server level:

/var/log/nginx/error.log          # upstream timed out, connect() failed
/var/log/nginx/access.log         # are Cloudflare requests arriving at all?
/var/log/apache2/error.log        # MaxRequestWorkers reached
/var/log/php*-fpm.log             # pm.max_children reached
/var/log/auth.log, ufw status, iptables -S   # firewall drops
Cloudflare dashboard > DNS        # the origin A/AAAA record and proxy status

Cloudflare's own documentation distinguishes two cases: the origin never completed the TCP handshake, or it connected but did not acknowledge the request within the timeout. Knowing which one applies narrows the cause quickly.

Quick Fix Breakdown (DIY)

  • Confirm the origin is alive. Test it directly, bypassing Cloudflare, with the origin IP:
curl -I --resolve example.com:443:ORIGIN_IP https://example.com/ --max-time 15
  • Check the DNS record. The proxied A/AAAA record must point to the current server IP. A stale IP after a migration is a very common cause.
  • Allow Cloudflare's IP ranges. Firewalls, security plugins, host-level rate limits and tools such as fail2ban or CSF can block Cloudflare because all visitors arrive from a few shared addresses. Allow the published ranges at https://www.cloudflare.com/ips/ and make sure your server logs the real visitor IP via CF-Connecting-IP (nginx real_ip module) so it does not ban Cloudflare itself.
  • Make sure the web server listens on the right port. Full SSL modes connect on 443, Flexible connects on 80. Check:
ss -tlnp | grep -E ':80|:443'
  • Look for overload. If the web server or PHP is saturated, new connections are dropped and Cloudflare times out. Check load, MaxRequestWorkers (Apache) or worker_connections (nginx) and PHP-FPM pm.max_children.
  • Enable keep-alive on the origin. With keep-alive disabled, every request pays a full handshake and the origin can fall behind.
  • Pause Cloudflare to compare. Setting the record to DNS only (grey cloud) shows whether the site works without the proxy. If it fails too, the problem is the origin.
  • Check the host. Some hosts block or throttle unfamiliar IP ranges or run security rules that treat Cloudflare as a bot network. Ask them in writing whether Cloudflare ranges are allowed.
  • Slow origin requests. If a heavy admin or import request exceeds Cloudflare's wait, you will see a 524 (timeout after the connection was made) rather than a 522; the two are treated differently.

If none of these isolates it within an hour, stop. Every extra hour is lost orders and lost search visibility.

Hand It Over: $99 Fixed, Within 48 Hours

A 522 drags on because the cause can sit in DNS, the firewall, the web server or the host, and each owner points at the other. One developer who checks all four ends the guessing.

What you get for $99:

  • A fixed price agreed before work starts. One issue, one flat fee, no hourly meter.
  • Delivery within 48 hours of access, with changes verified before they are left in place.
  • Fully written, fully async. You send the domain, when it started and what changed recently (migration, firewall, plugin, traffic spike). You get questions, progress and proof in writing. There are no calls, meetings or project managers.
  • Written proof it works: the root cause in plain language, which settings changed, a before and after check, and a rollback note.
  • Money-back guarantee if the agreed root cause cannot be resolved.
  • Safe access only: a limited Cloudflare, SSH or hosting account that you can revoke. Never send passwords through the inquiry form.

If the 522 is replaced by a redirect loop after you change SSL mode, see Cloudflare ERR_TOO_MANY_REDIRECTS on WordPress. If the site shows a database error behind Cloudflare, see Error establishing a database connection.

Behind it: 20+ years in production (since Oct 2006) and 100+ projects in the portfolio.

Get this error fixed for $99 → · Queue an urgent fix · See past projects

For broader fixes, see bug-fix services.

Frequently Asked Questions

What does Cloudflare Error 522 mean?

Cloudflare could not establish or complete a connection to your origin server in time. The usual causes are a blocked Cloudflare IP range, a wrong origin IP, an overloaded server or a web server that is not listening on the expected port.

Why do I get 522 only sometimes?

Intermittent 522s usually point to overload or rate limiting: the origin drops connections during traffic spikes, or a firewall occasionally blocks a Cloudflare address. Check logs at the time of failures.

What is the difference between 522 and 524?

A 522 means the connection to the origin timed out. A 524 means the connection succeeded but the origin took too long to respond. They have different fixes.

How much does it cost to fix a Cloudflare 522 error?

SazM fixes one issue for a fixed $99, delivered within 48 hours, with a money-back guarantee if the agreed root cause cannot be resolved. Typical agency hourly rates are higher and open-ended, while very low marketplace gig prices rarely include root-cause diagnosis, a staging test or a guarantee.

Do I need a call to explain the problem?

No. Send the domain, the time it started and what changed recently. A written report is more precise than a call.

// SazM ENGINEERING DISPATCH · PRODUCTION REMEDIATION

Senior Engineering Without Agency Overhead

// TRACK A · FIXED-PRICE FIXES (48H SLA)

Single Urgent or Speed Fix

Immediate code-level fixes with zero discovery calls. Emergency root-cause patch within 48 hours for $99, or full Core Web Vitals & speed remediation with before/after audit for $199. 100% money back if the agreed root cause cannot be fixed.

Running WordPress or WooCommerce? The WordPress care plan keeps your site updated, hardened, backed up daily, and monitored for $49/mo.

// TRACK B · SENIOR RETAINER & BUILDS

Monthly Plan or Custom Scope

Direct senior-level capacity embedded in your stack. Dedicated monthly engineering ($999/mo, 1 active task at a time, 24–48h PR delivery, pause or cancel anytime), or fixed-scope architectural milestones delivered within a 24h written quote.

✓ 20+ years engineering ✓ 100+ projects in the portfolio ✓ Fixes within 48 hours ✓ 100% money back if not fixed
1 Active Task at a Time
Requests are completed one by one in your priority order. As soon as an active task is shipped, tested, and approved, work starts immediately on your next task within our 24–48h SLA.
48h Emergency SLA
Clock starts as soon as site access details are provided. Delivered with full backup taken first, isolated staging testing, and 100% money back if not fixed.
WordPress Care Plan Scope
Weekly core and plugin updates pre-tested in staging, daily offsite encrypted backups, 24/7 uptime monitoring, and proactive security patching.
Pay Nothing Upfront
Zero upfront payment or credit card required. A 20-Year Senior Engineer diagnoses your issue, reproduces it on isolated staging, and deploys the fix. You only pay once you verify the staging reproduction or production fix.