520 Web Server Returns an Unknown Error

Cloudflare received an origin response it could not interpret as an expected, usable HTTP response.

All HTTP status codes

What does HTTP 520 mean?

A 520 groups origin behaviours that do not fit a more specific Cloudflare error. The visible page does not identify the root cause. Start with one failing URL and Ray ID, then inspect what the origin actually returned or whether it closed unexpectedly. Compare origin and proxied requests carefully so the same hostname and application path are tested.

An investigation example

Illustrative edge-error investigation
Public result: 520 Web Server Returns an Unknown Error
Origin trace shows an empty reply during a worker crash.
Action: repair the crashing process and retain its exception details.
Verify: proxied requests return valid headers and content without recurring resets.

Common causes

  • An origin process exits or closes a connection before sending a complete usable response.
  • Malformed or excessively large response headers prevent the edge from processing the result.
  • An origin security or protocol configuration disrupts requests arriving through Cloudflare.

Diagnose the response

Correlate the Cloudflare Ray ID with origin logs and inspect resets, response formatting and response-header size.

  • Save the Ray ID, URL and timestamp, then locate the matching origin request. Compare a controlled origin request using the correct hostname to isolate edge-to-origin behaviour.
  • Check crashes, connection termination and response-header construction. Review recent runtime or protocol changes when only certain routes trigger the error.
  • Validate the full public request after repairing the origin. A successful direct-origin request alone does not establish that Cloudflare can process the same exchange.

What it means for website monitoring

Use the public failure time and Ray ID to connect Sitepulse evidence to Cloudflare and origin logs. Check repeated requests after repair because the error can be intermittent.

Reference