⏱️
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);