🤷
520
Web Server Returns Unknown Error
Example HTTP Response
HTTP Response
HTTP/1.1 520 Web Server Returns Unknown Error
Server: cloudflare
Content-Type: text/html
<html><body>Web server is returning an unknown error</body></html>Common Causes
- Origin server returned empty or malformed response
- Origin sent invalid HTTP headers
- Origin crashed while generating response
- Origin returned a response violating HTTP protocol
- PHP Fatal Error or similar backend crash
- Origin's web server misconfiguration
Technical Details
What does this mean?
The server just said something completely incomprehensible! Cloudflare asked your origin server a question and got back gibberish. It's like asking for directions and getting a reply in ancient hieroglyphics.
Technical Definition
The origin web server returned an unexpected or unrecognized response to 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(520).json({
error: 'Web Server Returns Unknown Error',
message: 'Your error message here'
});
});
// Native HTTP
const http = require('http');
http.createServer((req, res) => {
res.writeHead(520, { 'Content-Type': 'application/json' });
res.end(JSON.stringify({
error: 'Web Server Returns Unknown Error',
message: 'Your error message here'
}));
}).listen(3000);Related Status Codes