NEWStandard createTask and in.php APIs. Change the address and you are connected.View API docs
GATESOLVER

Errors and troubleshooting

What is Cloudflare error 520?

Error 520 "Web server is returning an unknown error" means Cloudflare reached the site's own server, but what came back was empty, malformed or cut off. Cloudflare cannot pass it on, so it shows this page instead.

The answer

Cloudflare sits between you and the site's origin server. A 520 means the connection to the origin worked, but the origin's reply broke Cloudflare's expectations: the connection was reset, the response was empty, the headers were invalid or too large, or the origin crashed mid-response. It is a catch-all for "the origin misbehaved in a way that has no better code". Most of the time the cause is on the site's side and fixes itself. Occasionally, something in your request provokes the failure.

Causes on the site's side

  • The application crashed or restarted while handling the request.
  • A firewall or security module on the origin dropped Cloudflare's connection.
  • The origin sent response headers above Cloudflare's size limit, often because of many large cookies.
  • Keep-alive settings mismatched between Cloudflare and the origin, so connections were closed unexpectedly.

You cannot fix these. What you can do is detect them, back off and retry later.

Causes your request can trigger

  • Oversized request headers or cookies. A cookie jar that grows over a long session (tracking cookies, repeated set-cookie values) can push the origin into failing. Start fresh sessions periodically and drop cookies you do not need.
  • Unusual input. Very long query strings, odd encodings or malformed bodies can crash fragile backends.
  • Specific pages. A product or search page with a bug fails for everyone; if only certain URLs return 520, it is that page, not you.
  • Load. A burst of heavy requests can tip a weak origin over, producing 520s for a while.

A quick way to tell

  1. Open the same URL in a normal browser from a different connection. If it fails there too, it is the site.
  2. Retry your request with a clean cookie jar and minimal headers. If that works, your session state was the trigger.
  3. Compare URLs. A 520 on one page and 200 on others points at that page's backend code.

Retrying sensibly

import random, time
import requests

RETRYABLE_CF = {520, 521, 522, 523, 524}

def fetch_with_patience(url, attempts=5):
    for attempt_no in range(attempts):
        with requests.Session() as fresh:
            reply = fresh.get(url, timeout=(5, 40))
        if reply.status_code not in RETRYABLE_CF:
            return reply
        pause = min(120, 2 ** attempt_no * 5) + random.uniform(0, 3)
        print(f"{reply.status_code} on {url}, sleeping {pause:.0f}s")
        time.sleep(pause)
    return reply

The function opens a new session on each attempt, which rules out a bloated cookie jar, and waits longer each time, following the exponential backoff pattern. Retrying 520s instantly in a tight loop adds load to a server that is already struggling.

What to log when 520s appear

Record the URL, the time, the proxy, the size of the cookie header you sent and the cf-ray response header for each 520. The ray id identifies the request in Cloudflare's systems, which is what a site owner would ask for if you report a broken page. The cookie size tells you at a glance whether your session state has grown unusually large. A spike of 520s across many URLs at the same minute is an origin incident; a steady trickle on one URL is a bug on that page.

How 520 relates to other 52x errors

CodeMeaning
520origin replied with something empty or invalid
521connection refused by the origin
522connection to origin timed out
523origin unreachable
524origin accepted but took too long to respond

All of them are origin-side problems reported by Cloudflare. The pages on error 522 and error 524 cover the timeout variants.

Is a 520 a block?

Usually not. Blocks come as 403, 1020, 1015 or a challenge page. A 520 means the request did reach the origin. However, some origin firewalls respond to suspected bots by resetting the connection, which Cloudflare then reports as 520. If you see 520 only from certain proxies or only after many requests, while browsers load the same page fine, treat it as a soft block: slow down, and check your session and identity. A 520 is never a CAPTCHA, so there is nothing to solve; GateSolver is useful on the Cloudflare challenge pages and Turnstile widgets that appear before the origin, not on origin failures.

Common questions

Is Cloudflare error 520 my fault?

Usually not. It is mostly an origin problem, but very large cookies or unusual requests can trigger it.

Should I retry a 520?

Yes, with growing delays and a fresh session. Instant retries add load to a struggling server.

What is the difference between 520 and 522?

520 means the origin replied badly; 522 means Cloudflare could not complete a connection to the origin in time.

Can a 520 be a bot block?

Sometimes. An origin firewall that resets suspected bots shows up as 520 through Cloudflare.

Does a CAPTCHA solver help with 520?

No. There is no challenge to answer; the origin failed to respond properly.

Keep reading