SiteError.comYour friendly guide to HTTP status codes
Status CodesBlog
  1. Home
  2. Cloudflare
  3. 522 Connection Timed Out

522 Connection Timed Out

⏱️
522
Connection Timed Out

Example HTTP Response

HTTP Response
HTTP/1.1 522 Connection Timed Out
Server: cloudflare
Content-Type: text/html

<html><body>Connection timed out</body></html>
Common Causes
  • Origin server overloaded and slow to respond
  • Database queries taking too long
  • Long-running scripts exceeding timeout
  • Resource exhaustion (CPU, memory, disk I/O)
  • Inefficient code or infinite loops
  • Origin server's keep-alive timeout too short
Technical Details

What does this mean?

Your server is playing the silent game! Cloudflare connected successfully but your origin just... sits there. It's like calling someone who picks up the phone then says absolutely nothing.

Technical Definition

Cloudflare established a TCP connection but the origin did not reply with an HTTP response before the connection timed out.

Code Snippets

Ready-to-use code for returning this HTTP status in your application:

Node.js
// Express.js
app.get('/example', (req, res) => {
  res.status(522).json({
    error: 'Connection Timed Out',
    message: 'Your error message here'
  });
});

// Native HTTP
const http = require('http');

http.createServer((req, res) => {
  res.writeHead(522, { 'Content-Type': 'application/json' });
  res.end(JSON.stringify({
    error: 'Connection Timed Out',
    message: 'Your error message here'
  }));
}).listen(3000);
Related Status Codes
⌛504Gateway Timeout⏰408Request Timeout

522 Connection Timed Out FAQ

What causes a 522 Connection Timed Out error?

Origin server overloaded and slow to respond. Database queries taking too long. Long-running scripts exceeding timeout. Resource exhaustion (CPU, memory, disk I/O). Inefficient code or infinite loops. Origin server's keep-alive timeout too short.

521 Web Server Is Down523 Origin Is Unreachable

Popular Status Codes

  • 200 OK
  • 301 Moved Permanently
  • 302 Found
  • 400 Bad Request
  • 401 Unauthorized
  • 403 Forbidden
  • 404 Not Found
  • 500 Internal Server Error
  • 502 Bad Gateway
  • 503 Service Unavailable

Compare Codes

  • 401 vs 403
  • 301 vs 302
  • 404 vs 410
  • 500 vs 502
  • Compare any codes →

Categories

  • Informational
  • Success
  • Redirection
  • Client Error
  • Server Error
  • NGINX
  • Cloudflare
  • AWS ELB
  • Microsoft IIS

Tools

  • Cheat Sheet
  • Status Code Quiz
  • URL Checker
  • API Playground
  • Blog

© 2026 SiteError.com. All rights reserved.