SiteError.comYour friendly guide to HTTP status codes
Status CodesBlog
  1. Home
  2. Cloudflare
  3. 520 Web Server Returns Unknown Error

520 Web Server Returns Unknown Error

๐Ÿคท
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
๐Ÿ’ฅ500Internal Server Error๐ŸŒ‰502Bad Gateway

520 Web Server Returns Unknown Error FAQ

What causes a 520 Web Server Returns Unknown Error error?

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.

499 Client Closed Request521 Web Server Is Down

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.