🚫
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