SiteError.comYour friendly guide to HTTP status codes
Status CodesBlog
  1. Home
  2. Cloudflare
  3. 521 Web Server Is Down

521 Web Server Is Down

🚫
521
Web Server Is Down

Example HTTP Response

HTTP Response
HTTP/1.1 521 Web Server Is Down
Server: cloudflare
Content-Type: text/html

<html><body>Web server is down</body></html>
Common Causes
  • Origin web server is not running (stopped/crashed)
  • Firewall blocking Cloudflare IP addresses
  • Origin listening on wrong port
  • Server overload causing service to stop
  • Origin IP address changed but Cloudflare DNS not updated
  • iptables or security group blocking Cloudflare
Technical Details

What does this mean?

Nobody's home! Cloudflare knocked on your server's door but it's locked up tight. Either the server shut down, went on vacation, or is hiding behind the curtains refusing to answer.

Technical Definition

The origin server refused the connection from Cloudflare. The origin's web server is not running or a firewall is blocking Cloudflare.

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(521).json({
    error: 'Web Server Is Down',
    message: 'Your error message here'
  });
});

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

http.createServer((req, res) => {
  res.writeHead(521, { 'Content-Type': 'application/json' });
  res.end(JSON.stringify({
    error: 'Web Server Is Down',
    message: 'Your error message here'
  }));
}).listen(3000);
Related Status Codes
🌉502Bad Gateway🔧503Service Unavailable

521 Web Server Is Down FAQ

What causes a 521 Web Server Is Down error?

Origin web server is not running (stopped/crashed). Firewall blocking Cloudflare IP addresses. Origin listening on wrong port. Server overload causing service to stop. Origin IP address changed but Cloudflare DNS not updated. iptables or security group blocking Cloudflare.

520 Web Server Returns Unknown Error522 Connection Timed Out

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.