Skip to content
Cloudflare Docs

Error 520

Error 520: web server returns an unknown error

This error occurs when the origin server returns an empty, unknown, or unexpected response to Cloudflare.

Common causes

This error is often triggered by:

  • Origin server crashes or misconfigurations.
  • Firewalls or security plugins blocking Cloudflare IPs at your origin.
  • Headers exceeding 16 KB (often due to excessive cookies).
  • Empty or malformed responses lacking an HTTP status code or response body.
  • Missing response headers or origin web server not returning proper HTTP error responses.
  • Incorrect HTTP/2 configuration at the origin server.

Resolution

  • Contact your hosting provider or site administrator and share the necessary error details to assist with troubleshooting. Request a review of your origin web server error logs for crashes and check for common causes mentioned in the previous section.

  • If HTTP/2 is enabled at your origin server, ensure it is correctly set up. Cloudflare connects to servers who announce support of HTTP/2 connections via ALPN. If the origin web server accepts the HTTP/2 connection but then does not respect or support the protocol, an HTTP 520 error will be returned. You can disable the HTTP/2 to Origin in Speed > Optimization > Protocol Optimization on the Cloudflare dashboard.

  • If 520 errors continue after contacting your hosting provider or site administrator, provide the following information to Cloudflare Support:

    • Full URL(s) of the resource requested when the error occurred.
    • Cloudflare cf-ray from the 520 error message.
    • Output from http://<YOUR_DOMAIN>/cdn-cgi/trace.
    • Two HAR files: