# Cloudflare 520: your server returned an unknown error

> Cloudflare error 520 means your origin server sent an empty, malformed or unexpected response that Cloudflare couldn’t pass on.

URL: https://yes-seo.com/http-status-codes/520

**Error 520: Web Server Returned an Unknown Error** is a Cloudflare-specific code. Cloudflare reached your origin server, but what came back was empty, malformed or otherwise unexpected, so Cloudflare can’t pass a normal response to the visitor. It’s Cloudflare’s catch-all for “your server did something strange.”

## What Cloudflare means by 520

520 isn’t part of the HTTP standard or the IANA registry. Cloudflare defines it in its [documentation on 5xx errors](https://developers.cloudflare.com/support/troubleshooting/http-status-codes/cloudflare-5xx-errors/) as the origin returning an empty, unknown or unexpected response. The connection itself worked, which separates it from [521](https://yes-seo.com/http-status-codes/521) (connection refused) and [522](https://yes-seo.com/http-status-codes/522) (connection timed out). Every Cloudflare error page shows a **Ray ID**, also sent in the `cf-ray` header, which identifies the request in Cloudflare’s logs.

## Common causes

- **The application crashed** mid-request and the server closed the connection without a response.

- **Response headers too large**, often because of many or oversized cookies.

- **An empty response**, with no status line or headers, from a misbehaving app or proxy.

- **Malformed headers** that Cloudflare can’t parse.

- **Security software at the origin** resetting connections from Cloudflare’s IP addresses.

## SEO impact

To Googlebot, a 520 is a 5xx server error. [Google’s documentation](https://developers.google.com/search/docs/crawling-indexing/http-network-errors) says server errors make it slow down crawling, and URLs that keep failing are removed from the index. Intermittent 520s are especially sneaky: you reload and the page works, but Googlebot keeps hitting failures. Check Search Console’s Crawl Stats report for server errors and when they happen.

## How to fix a 520

### For site owners

- Note the Ray ID, the URL and the exact time of the error.

- Ask your host for the origin’s error logs at that moment; the crash or reset usually shows there.

- Make sure your host or security plugin isn’t blocking [Cloudflare’s IP ranges](https://www.cloudflare.com/ips/).

### For developers

Send the request to the origin directly, bypassing Cloudflare, to see the raw response:

```
# replace 203.0.113.10 with your origin IP
curl -sv --resolve www.example.com:443:203.0.113.10 \
  https://www.example.com/problem-page/ -o /dev/null
```

- If the origin returns no headers or the connection drops, find the crash in the application logs and fix it.

- Measure the header size with `curl -sI` against the origin, and trim cookies and long headers.

- Restore real visitor IPs from `CF-Connecting-IP` so rate limiters and firewalls don’t treat Cloudflare as one abusive client.

- If you can’t find the cause, open a ticket with Cloudflare and include Ray IDs and origin logs.

## How to check

The [HTTP status checker](https://yes-seo.com/http-status-checker) requests your URLs through Cloudflare like any visitor and shows which ones return 520. The [HTTP header checker](https://yes-seo.com/http-header-checker) shows the `server: cloudflare` and `cf-ray` headers that confirm the error came from Cloudflare’s edge. For a generic origin failure without Cloudflare in front, the equivalent would be [502](https://yes-seo.com/http-status-codes/502).

```
HTTP/2 520
date: Fri, 30 Oct 2026 10:41:07 GMT
content-type: text/html; charset=UTF-8
server: cloudflare
cf-ray: 8d2f4b7c1e9a3f21-CDG
```

## Frequently asked questions

### Is error 520 Cloudflare’s fault or my server’s?

Almost always the origin server’s. Cloudflare connected fine, but your server sent an empty or invalid response. Your origin logs at the time of the Ray ID usually show why.

### Why does a 520 appear only sometimes?

Intermittent 520s usually point to an application that crashes under certain requests or load, or to cookies that grow until the headers become too large. Compare failing and working requests in the origin logs.

### Does Cloudflare error 520 hurt SEO?

It can. Googlebot sees a 5xx error, slows down crawling and, if the errors persist, drops affected URLs from the index. Short, rare incidents usually do no lasting damage.

