---
title: "Cloudflare Error 1020 Access Denied: causes and fixes"
url: https://proxy.wiki/guides/cloudflare-error-1020/
type: Guide
author: "proxy.wiki editorial"
published: 2026-10-21
updated: 2026-10-21
site: proxy.wiki
topics: ["Anti-bot systems"]
license: CC BY 4.0; quote freely with attribution to https://proxy.wiki/
---

# Cloudflare Error 1020 Access Denied: causes and fixes

> Error 1020 is Cloudflare's 403 for a request a site's security settings blocked. How to read it, tell it from proxy errors, and get it fixed.

## Key takeaways

- Error 1020 means a Cloudflare security feature configured by the site owner blocked the request; it comes back as HTTP 403, and API clients see the one-line body "error code: 1020".
- Requests blocked by WAF custom or managed rules now get the "Sorry, you have been blocked" page instead; Cloudflare's current examples of 1020 are API Shield schema validation and JWT validation.
- Only the site owner can lift it: the visitor sends the Ray ID and time, and the owner finds the matching event in Security Events.
- Through a proxy, a real 1020 always arrives inside an open tunnel, which curl shows as proxy=200 site=403. A 403, 407 or 503 to CONNECT, or a certificate error, is the proxy failing, not Cloudflare.
- /cdn-cgi/trace on the blocking site, run through the same proxy, shows the IP, country and TLS details Cloudflare evaluated.

Error 1020 means a security setting chosen by the website’s owner blocked your request at Cloudflare. In a browser it is a Cloudflare page reporting **Error 1020: Access denied**, with a Ray ID. curl, Python, Node and other API clients get the short form: a `403 Forbidden` whose entire body is one line.

```
error code: 1020
```

Cloudflare’s documentation defines it as [“a Cloudflare security feature configured by the website owner blocked the request”](https://developers.cloudflare.com/support/troubleshooting/http-status-codes/cloudflare-1xxx-errors/error-1020/), sent with HTTP status 403. Only the owner can undo it. Your proxy provider cannot, and Cloudflare’s own pages for the related 10xx blocks say its support staff cannot override a customer’s security settings either. A visitor sends the owner the Ray ID. The owner looks that Ray ID up in Security Events and sees which rule fired.

Most of the work is earlier than that: proving the 403 really is a 1020. Proxies, origin servers and Cloudflare’s other security products all produce 403s that get reported as “error 1020”, and each one has a different fix.

**Old advice describes an old product.** Cloudflare’s legacy Firewall Rules answered a Block with a 1020 page. Firewall Rules were upgraded to WAF custom rules, and the old API has been unsupported since 15 June 2025. Cloudflare now states that requests blocked by WAF custom rules or WAF managed rules _do not_ get a 1020; they get the WAF block page. Its current examples of 1020 sources are API Shield schema validation and JWT validation. Guides that equate 1020 with “a firewall rule” predate that change.

## What a real 1020 response looks like

We did not manufacture a 1020. That would need a Cloudflare zone configured to block us, and we changed no Cloudflare settings for this page. Two real responses stand in instead. The first is a 1020 that a developer pasted into the [Zoom Developer Forum](https://devforum.zoom.us/t/error-code-1020/78374) on 6 November 2022, after a request to `api.zoom.us` carrying a valid token. Headers as posted, with the NEL, Report-To and cookie lines removed:

```
HTTP/1.1 403 Forbidden
Content-Length: 16
Cache-Control: private, max-age=0, no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Cf-Ray: 7661a368fad2c4cf-SEA
Content-Type: text/plain; charset=UTF-8
Date: Sun, 06 Nov 2022 23:34:10 GMT
Expires: Thu, 01 Jan 1970 00:00:01 GMT
Referrer-Policy: same-origin
Server: cloudflare
X-Frame-Options: SAMEORIGIN

error code: 1020
```

The second is ours. On 21 October 2026 we requested one of the Cloudflare addresses that `proxy.wiki` resolves to by bare IP, which Cloudflare refuses with error 1003, “Direct IP access not allowed”. Same machinery, same status, nothing trimmed:

```
$ curl -sS -i http://104.21.91.68/
HTTP/1.1 403 Forbidden
Date: Wed, 21 Oct 2026 19:52:34 GMT
Content-Type: text/plain; charset=UTF-8
Content-Length: 17
Connection: keep-alive
Cache-Control: private, max-age=0, no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Expires: Thu, 01 Jan 1970 00:00:01 GMT
Referrer-Policy: same-origin
X-Frame-Options: SAMEORIGIN
Server: cloudflare
CF-RAY: a4e2cdaee8a3a2bf-SOF

error code: 1003
```

Four years apart, the shape has not moved.

| Field | 1020 from api.zoom.us (2022, as posted) | 1003 from our capture (2026) |
| --- | --- | --- |
| Status | 403 Forbidden | 403 Forbidden |
| Content-Type | text/plain; charset=UTF-8 | text/plain; charset=UTF-8 |
| Body | error code: 1020, 16 bytes | error code: 1003 plus a newline, 17 bytes |
| Expires | Thu, 01 Jan 1970 00:00:01 GMT | Thu, 01 Jan 1970 00:00:01 GMT |
| Server | cloudflare | cloudflare |
| Ray ID | 7661a368fad2c4cf-SEA | a4e2cdaee8a3a2bf-SOF |
| cf-cache-status | absent | absent |

The message is the server talking, not your HTTP library. When a user asked the curl-users list about it in April 2021, curl’s lead developer Daniel Stenberg [replied](https://curl.se/mail/archive-2021-04/0034.html) that “The “error code 1020″ text is content from the server”. His suggested `--trace-ascii -` shows it arriving as response data:

```
$ curl -s --trace-ascii - -o /dev/null http://104.21.91.68/
...
<= Recv header, 24 bytes (0x18)
0000: HTTP/1.1 403 Forbidden
...
<= Recv data, 17 bytes (0x11)
0000: error code: 1003.
```

No flag will make that message more detailed. Seventeen bytes is everything the edge sent. The part worth keeping is the `CF-RAY` header, because the owner needs it.

## Things that look like error 1020 but are not

Cloudflare documents several block pages, each with its own trigger. A proxy in the path adds two more failure modes that end in a 403 or 407. Read the status, the `server` header and the body before deciding what you have.

| What you see | Who produced it | How to tell | Where the fix is |
| --- | --- | --- | --- |
| error code: 1020, or an “Error 1020” page | Cloudflare: a security feature’s Block with no custom response | 403, server: cloudflare, cf-ray | Owner’s Security Events, by Ray ID |
| “Sorry, you have been blocked” | Cloudflare: WAF custom or managed rule | 403 HTML page with Ray ID | Owner’s WAF rules |
| “Just a moment…” | Cloudflare challenge, not a block | cf-mitigated: challenge | A browser can pass it; scripts cannot |
| error code: 1005, 1006, 1007, 1008, 1009, 1106 | Cloudflare: ASN, IP or country block, or Zone Lockdown | Same 403 shape as 1020 | Owner’s IP Access rules or Zone Lockdown |
| error code: 1010 | Cloudflare: Browser Integrity Check | 403, browser signature | Owner can turn the check off |
| error code: 1015 | Cloudflare: rate limiting rule | Status 429, not 403 | Wait; owner reviews thresholds |
| The site’s own 403 page or text | The origin server, relayed by Cloudflare | cf-ray plus cf-cache-status | The site’s application |
| curl: (56) CONNECT tunnel failed, response 403 | Your proxy | No cf-ray; proxy’s own headers | Proxy policy or provider |
| curl: (56) CONNECT tunnel failed, response 407 | Your proxy | Proxy wants credentials | Proxy username and password |

The WAF block page is the closest lookalike. An [OONI measurement from 19 August 2022](https://explorer.ooni.org/m/20220819190205.630557_KZ_webconnectivity_a5ab504c670058f1) preserves a complete copy: a 403 titled “Attention Required! | Cloudflare”, headed “Sorry, you have been blocked”, with the Ray ID at the foot.

We met a challenge while researching this page. A plain curl request for a Cloudflare Community thread came back as a 403 titled “Just a moment…” with this header set:

```
HTTP/2 403
content-type: text/html; charset=UTF-8
content-length: 5443
cf-mitigated: challenge
server: cloudflare
cf-ray: a4e2d574cd2f16f3-SOF
```

Cloudflare [documents](https://developers.cloudflare.com/cloudflare-challenges/challenge-types/challenge-pages/detect-response/) `cf-mitigated: challenge` as the reliable way to recognise a challenge, and `challenge` as its only valid value. A front end calling its own API can test for it directly.

The origin case is easy to misread. On proxy.wiki, `/xmlrpc.php` is refused by nginx at the origin. Through Cloudflare the reply carries `server: cloudflare` and a Ray ID, so it looks like an edge block:

```
$ curl -sS -i https://proxy.wiki/xmlrpc.php
HTTP/2 403
content-type: text/plain; charset=UTF-8
server: cloudflare
cache-control: no-store, no-cache, must-revalidate, max-age=0
cf-cache-status: DYNAMIC
cf-ray: a4e2ce0a0c98d0d4-SOF

XML-RPC is disabled on this site.
```

The giveaway is `cf-cache-status: DYNAMIC`. Cloudflare’s [cache documentation](https://developers.cloudflare.com/cache/concepts/cache-responses/) says that status means the request “went to the origin web server”. None of the three edge-generated responses on this page carried a `cf-cache-status` header. That is an observation from three samples, not a documented guarantee, so treat it as a strong hint.

## Is it the proxy or the site? One curl command

An HTTPS request through an HTTP proxy happens in two steps. The client sends [CONNECT](/glossary/http-connect/) to the proxy and waits. Only after the proxy answers 200 does TLS with the website begin, inside the tunnel. Cloudflare can only answer in step two, so a genuine 1020 can only arrive through a tunnel that opened. curl reports both answers separately. Its manual defines `%{http_connect}` as the code from the proxy’s response to CONNECT:

```
curl -sS -o /dev/null \
  -w 'proxy=%{http_connect} site=%{http_code}\n' \
  -x http://user:pass@gw.example.net:8080 https://example.com/
```

Here is what that pair of numbers looked like in our lab, a Squid 6.13 proxy on 127.0.0.1 with one port per failure. The target in the first row is the real Cloudflare edge.

| Case | curl 8.7.1 says | proxy= | site= | Exit code |
| --- | --- | --- | --- | --- |
| Site’s own 403 through an open proxy | nothing; transfer completes | 200 | 403 | 0 |
| Proxy refuses the destination | curl: (56) CONNECT tunnel failed, response 403 | 403 | 000 | 56 |
| Proxy wants credentials | curl: (56) CONNECT tunnel failed, response 407 | 407 | 000 | 56 |
| Proxy cannot reach the target port | curl: (56) CONNECT tunnel failed, response 503 | 503 | 000 | 56 |
| Proxy cannot resolve the target | curl: (56) CONNECT tunnel failed, response 503 | 503 | 000 | 56 |

A real 1020 through a proxy always reads `proxy=200 site=403`. Any other value in `proxy=` means Cloudflare never saw the request. The same split shows up in every client we tried, in different words:

| Case | Python requests 2.32.3 | httpx 0.27.2 | Node v24.2.0 fetch | Chrome 155 headless |
| --- | --- | --- | --- | --- |
| 403 from the site, inside the tunnel | HTTP 403; raise_for_status: 403 Client Error: Forbidden for url | HTTP 403; Client error '403 Forbidden' | HTTP 403, server=cloudflare | Page renders, document status 403 |
| Proxy refuses (403) | ProxyError(... 'Tunnel connection failed: 403 Forbidden') | httpx.ProxyError: 403 Forbidden | UND_ERR_ABORTED Proxy response (403) !== 200 when HTTP Tunneling | net::ERR_TUNNEL_CONNECTION_FAILED |
| Proxy wants credentials (407) | Tunnel connection failed: 407 Proxy Authentication Required | httpx.ProxyError: 407 Proxy Authentication Required | Proxy response (407) !== 200 when HTTP Tunneling | net::ERR_INVALID_AUTH_CREDENTIALS |
| Upstream refused (503) | Tunnel connection failed: 503 Service Unavailable | httpx.ProxyError: 503 Service Unavailable | Proxy response (503) !== 200 when HTTP Tunneling | net::ERR_TUNNEL_CONNECTION_FAILED |
| TLS intercepted, CA not trusted | SSLError(... CERTIFICATE_VERIFY_FAILED ... self signed certificate | httpx.ConnectError: [SSL: CERTIFICATE_VERIFY_FAILED] | DEPTH_ZERO_SELF_SIGNED_CERT self-signed certificate | net::ERR_CERT_AUTHORITY_INVALID |

In a browser the rule is simpler still. A 1020 is a web page. A proxy failure is Chrome’s own error screen.

**How we tested.** One run per case on 21 October 2026, macOS. Proxies: Squid 6.13 on 127.0.0.1 (open, deny-by-destination and basic-auth ports) and a 44-line Python intercepting proxy (Python 3.15.0, OpenSSL 4.0.3) with a self-signed certificate. Targets: proxy.wiki through Cloudflare, a Cloudflare edge IP, and closed or unresolvable addresses for the upstream cases. Clients: curl 8.7.1 (SecureTransport, LibreSSL 3.3.6), Python 3.9.6 with requests 2.32.3, urllib3 2.3.0 and httpx 0.27.2, Node v24.2.0 built-in fetch with `NODE_USE_ENV_PROXY=1`, and Chrome 155.0.8059.85 headless driven over the DevTools protocol. Our own IP is redacted from trace output.

To classify a failure from a script, this helper names the producer of the response. It checks for the plain-text and “Error 1020” forms of a 10xx body, the challenge header, the WAF block page heading and `cf-cache-status`, in that order:

```
# classify_403.py - tested with Python 3.9.6, requests 2.32.3
# Usage: python3 classify_403.py URL [PROXY_URL]
import re, sys
import requests

def classify(url, proxy=None):
    proxies = {"http": proxy, "https": proxy} if proxy else None
    try:
        r = requests.get(url, proxies=proxies, timeout=15)
    except requests.exceptions.ProxyError as e:
        m = re.search(r"Tunnel connection failed: (\d{3}[^'\")]*)", str(e))
        return "PROXY refused the CONNECT: " + (m.group(1) if m else str(e)[:120])
    except requests.exceptions.SSLError:
        return "TLS FAILED: certificate not trusted (an intercepting proxy is one cause)"
    h = r.headers
    if h.get("server", "").lower() != "cloudflare" or "cf-ray" not in h:
        return f"HTTP {r.status_code}, not from Cloudflare (server: {h.get('server', '-')})"
    ray = h["cf-ray"]
    m = re.search(r"\b[Ee]rror(?: code)?:? ?(1\d{3})\b", r.text[:4000])
    if m:
        return f"CLOUDFLARE error {m.group(1)}, HTTP {r.status_code}, Ray ID {ray}"
    if h.get("cf-mitigated") == "challenge":
        return f"CLOUDFLARE challenge page, HTTP {r.status_code}, Ray ID {ray}"
    if "Sorry, you have been blocked" in r.text:
        return f"CLOUDFLARE WAF block page, HTTP {r.status_code}, Ray ID {ray}"
    if "cf-cache-status" in h:
        return (f"ORIGIN answered HTTP {r.status_code}, relayed by Cloudflare "
                f"(cf-cache-status: {h['cf-cache-status']}), Ray ID {ray}")
    return f"HTTP {r.status_code} through Cloudflare, not classified, Ray ID {ray}"

if __name__ == "__main__":
    print(classify(sys.argv[1], sys.argv[2] if len(sys.argv) > 2 else None))
```

Its output against the real and lab cases:

```
$ python3 classify_403.py http://104.21.91.68/
CLOUDFLARE error 1003, HTTP 403, Ray ID a4e2dc2deeeba2bf-SOF
$ python3 classify_403.py https://proxy.wiki/xmlrpc.php http://127.0.0.1:41020
ORIGIN answered HTTP 403, relayed by Cloudflare (cf-cache-status: DYNAMIC), Ray ID a4e2dc2e9a880bcf-SOF
$ python3 classify_403.py https://community.cloudflare.com/t/472441.json
CLOUDFLARE challenge page, HTTP 403, Ray ID a4e2dc30487d5275-SOF
$ python3 classify_403.py https://proxy.wiki/ http://127.0.0.1:41021
PROXY refused the CONNECT: 403 Forbidden
$ python3 classify_403.py https://proxy.wiki/ http://127.0.0.1:41022
PROXY refused the CONNECT: 407 Proxy Authentication Required
$ python3 classify_403.py https://proxy.wiki/ http://127.0.0.1:41023
TLS FAILED: certificate not trusted (an intercepting proxy is one cause)
```

We had no live WAF block page or live 1020 to point it at, so those two branches are untested against a real response.

## Proxy failures that get reported as error 1020

### The proxy refuses the CONNECT

A proxy with a destination policy answers CONNECT with its own 403. Squid’s reply names itself, and no Ray ID appears anywhere:

```
> CONNECT proxy.wiki:443 HTTP/1.1
< HTTP/1.1 403 Forbidden
< Server: squid/6.13
< X-Squid-Error: ERR_ACCESS_DENIED 0
< Via: 1.1 pw-lab-proxy (squid/6.13)
* CONNECT tunnel failed, response 403
```

Squid’s access log recorded it as `TCP_DENIED/403 CONNECT proxy.wiki:443 ... ERR_ACCESS_DENIED`. The fix lives with whoever runs the proxy. Commercial providers block some destinations by policy, and the dashboard or support desk will say which. On your own Squid it is an `http_access` line. Our [curl proxy guide](/guides/how-to-use-a-proxy-with-curl/) covers reading the CONNECT exchange with `-v`.

### Proxy authentication fails

Missing or wrong credentials give a 407 to CONNECT, never a 403 from the site. Squid logged both of our attempts as `TCP_DENIED/407 ... ERR_CACHE_ACCESS_DENIED`, the second one with the username it rejected. Check the username and password, percent-encode any `@`, `:` or `/` in them, and confirm the proxy URL is reaching the client at all. The [403 vs 407 vs 429 guide](/guides/403-vs-407-vs-429/) and the [proxy authentication](/glossary/proxy-authentication/) entry go further.

### The proxy cannot reach the site

When the proxy’s own connection to the target fails, Squid answers 503. Its log separated the two causes we tried: `ERR_CONNECT_FAIL/errno=61` for a closed port (61 is “Connection refused” on macOS) and `ERR_DNS_FAIL` for a name that does not resolve. Nothing reached Cloudflare in either case. Check the hostname, the port, and the proxy’s DNS.

### TLS interception

An intercepting proxy, the kind corporate networks and some security products run, ends your TLS session and opens its own to the site. If your client does not trust the interceptor’s certificate, the request dies before HTTP: `curl: (60) SSL certificate problem: self signed certificate` in curl 8.7.1, `net::ERR_CERT_AUTHORITY_INVALID` in Chrome. See the [TLS interception](/glossary/tls-interception/) entry for how that works.

The quieter effect appears when the client does trust it. Then Cloudflare evaluates the interceptor’s connection, not yours. We asked proxy.wiki’s `/cdn-cgi/trace` endpoint, which Cloudflare serves on every proxied domain, what it saw directly and through our 44-line interceptor:

| trace field | curl 8.7.1, direct | Same curl, through the interceptor |
| --- | --- | --- |
| uag | curl/8.7.1 | curl/8.7.1 |
| http | http/2 | http/1.1 |
| tls | TLSv1.3 | TLSv1.3 |
| kex | X25519 | X25519MLKEM768 |

The user agent survived because the interceptor copied the header. The HTTP version and the key exchange are those of its own OpenSSL 4.0.3 client. A rule written on `http.request.version`, or on the JA3 and JA4 fields that Cloudflare Bot Management exposes to Enterprise customers, judges the interceptor. Our [ClientHello census](/research/tls-clienthello-fingerprints/) shows how much those fingerprints differ between real clients.

## The causes of a genuine 1020

Once the response checks out as a real 1020, the cause is one of the owner’s security features. These follow the order of Cloudflare’s own page: the general case first, then the two products it names.

### 1. A Block action with no custom response

Cloudflare’s common cause, in full: a security rule with a Block action matched the request, and the rule has no custom response configured. The visitor cannot tell which rule from the outside. The owner can. Visitors should send the Ray ID and the UTC time; the owner fixes it as described in the owner section below.

### 2. API Shield Schema Validation rejected the request

An API whose owner uploaded an OpenAPI schema can block requests that do not match it: a missing required parameter, a wrong type, a body that fits none of the allowed shapes. Body size counts too. [Schema Validation](https://developers.cloudflare.com/api-shield/security/schema-validation/) inspects bodies only up to a plan-specific size, and an oversized body is itself a violation.

_Default Schema Validation body size limit by Cloudflare plan, as listed in Cloudflare's API Shield documentation_

| Plan | Default body size limit (KiB) |
| --- | --- |
| Free | 1 |
| Pro | 8 |
| Business | 8 |
| Enterprise | 128 |

The diagnostic is a diff, not a network command. Compare the failing request with the API’s published specification: method, path, `Content-Type`, required fields, body size. If one endpoint fails and its neighbours work, suspect the schema before the network.

### 3. API Shield JWT validation failed

[JWT validation](https://developers.cloudflare.com/api-shield/security/jwt-validation/) checks tokens at the edge before the API sees them. A token that is expired, tampered with or badly signed fails, and so does a missing token when the owner chose “Mark as non-compliant”. Cloudflare only looks in the header or cookie the owner configured, so a token sent in a different header is, to Cloudflare, no token at all.

Check the token’s clock before anything else. This prints a JWT’s time claims without verifying the signature (Python 3.15.0, standard library only):

```
# jwt_exp.py - usage: python3 jwt_exp.py <token>
import base64, json, sys, time
def part(p): return json.loads(base64.urlsafe_b64decode(p + "=" * (-len(p) % 4)))
h, c = (part(p) for p in sys.argv[1].split(".")[:2])
now = int(time.time())
print("alg:", h.get("alg"), " kid:", h.get("kid"))
for k in ("iat", "nbf", "exp"):
    if k in c: print(f"{k}: {c[k]}  ({time.strftime('%Y-%m-%d %H:%M:%S', time.gmtime(c[k]))} UTC)")
if "exp" in c: print("expired" if c["exp"] < now else f"valid for {c['exp'] - now} more seconds")
print("aud:", c.get("aud"), " iss:", c.get("iss"))
```

Run on a test token we built to expire an hour earlier:

```
alg: HS256  kid: test-1
iat: 1792605737  (2026-10-21 18:02:17 UTC)
exp: 1792609337  (2026-10-21 19:02:17 UTC)
expired
aud: api.example.net  iss: https://auth.example.net
```

One browser-only trap belongs to the owner. CORS preflight requests use `OPTIONS` and by definition carry no credentials, so a strict JWT rule blocks them and the browser never sends the real request. Cloudflare’s documented fix is to add `or http.request.method eq "OPTIONS"` to the JWT validation rule.

### 4. A rule about where the request comes from

Rules can match the client IP, its [ASN](/glossary/asn/) (`ip.src.asnum`) and its country (`ip.src.country`). Through a proxy or VPN, “the client” is the exit. Cloudflare’s pages for 1005 and 1009 trace ASN and country bans to IP Access rules, which have their own codes, but any Block rule can use the same fields.

Find out what Cloudflare thinks your request looks like. Cloudflare adds a `/cdn-cgi/` endpoint to every domain it proxies, and `/cdn-cgi/trace` is its documented troubleshooting page, so run it against the site that blocked you, through the same proxy, with the same client:

```
$ curl -sS -x http://127.0.0.1:41020 https://proxy.wiki/cdn-cgi/trace
fl=74f100
h=proxy.wiki
ip=<redacted>
ts=1792613222.000
visit_scheme=https
uag=curl/8.7.1
colo=SOF
sliver=none
http=http/2
loc=BG
tls=TLSv1.3
sni=plaintext
warp=off
gateway=off
rbi=off
kex=X25519
```

That is our run through the lab Squid; with your own proxy, swap in its URL after `-x`. `ip` is the address the rules evaluate, `loc` the country Cloudflare assigned to it, and `colo` the data center that handled the request. If `loc` is not the country you expected, the proxy’s geolocation is the first suspect. Our [guide to proxy types](/guides/residential-vs-datacenter-proxies/) explains why datacenter and residential exits are treated differently.

The Zoom thread shows what this looks like from the outside. The first post reports valid tokens getting `error code: 1020`, “Only occurring on some AWS services”, while the same tokens worked from other machines. Some posters saw it clear the next day without changing anything; others still saw it from one Go client. A block that follows the network or the client, not the account, points at a rule of this kind or the next.

The legitimate fix is the owner’s. Confirm the pattern by repeating the request from your normal connection without the proxy or VPN. Then send the owner the Ray ID, the time and the exit IP from the trace. For automated access, ask for an API key or an allowlist entry for your egress addresses. Cycling exits until one gets through is working around a decision the owner made, and this page does not cover it.

### 5. A rule about how the request is made

Cloudflare’s rules language exposes the user agent (`http.user_agent`), every request header (`http.request.headers`), the HTTP version and, on Enterprise Bot Management, TLS fingerprints. Your client and any proxy in the path decide all of those. Over plain `http://`, a forwarding proxy edits the request itself. Our echo server saw this through Squid 6.13 with its default settings:

```
GET / HTTP/1.1
Host: 127.0.0.1:41030
User-Agent: curl/8.7.1
Accept: */*
Via: 1.1 pw-lab-proxy (squid/6.13)
X-Forwarded-For: 127.0.0.1
Cache-Control: max-age=259200
Connection: keep-alive
```

Four of those lines were not sent by curl. The [Via](/glossary/via-header/) and [X-Forwarded-For](/glossary/x-forwarded-for/) entries explain what each one reveals. Over HTTPS through CONNECT, a plain proxy cannot touch headers, which is one more reason the trace comparison above matters for intercepting ones. What libraries send before you configure anything is measured in our [default request headers](/research/default-request-headers/) research.

In the Zoom case, posters traced the failures to requests from one Go HTTP client, while the same token worked from Postman and JavaScript. For a developer, the useful reading is narrow: if one client fails and another succeeds with identical credentials, compare the two requests on the wire before blaming the account. Then take the difference to the API’s owner.

## If you own the site: find the rule

- Get the Ray ID and the time from the visitor. A screenshot of the 1020 page has both.

- Open **Security** > **Analytics**, **Events** tab, and filter on the Ray ID or the client IP. Convert the visitor’s UTC timestamp to your time zone first, as Cloudflare’s 1020 page advises.

- Read the event. It names the security feature and the rule that blocked the request.

- Change that rule: narrow its expression, add a Skip rule for traffic you trust, or switch the action to Managed Challenge where a human might be on the other end.

Two caveats from Cloudflare’s documentation save time. Security Events may show sampled data, so an event can be missing from a long time range; shorten the range and search again. Ray IDs are also not guaranteed unique, so match the time and IP as well. Sampled logs can be exported as JSON, up to 500 events at a time.

To replace the bare 1020 page with your own wording and a contact route, Cloudflare’s custom error rules match it by code:

```
(cf.response.1xxx_code eq 1020)
```

Pair that expression with an HTML response. For WAF custom rules, the custom response option on a Block action requires a Pro plan or higher. Whatever page you serve, keep the Ray ID visible. It is the only thing that lets a blocked visitor’s report be matched to an event.

## If you are the visitor

- Note the Ray ID, the time and your IP from the error page.

- Repeat the visit once without a VPN, proxy or browser extension that rewrites headers. If it works, the block is tied to that network or tool. Do not retry in a tight loop; Cloudflare’s rate-limit guidance warns that repeated attempts can extend a block.

- Contact the site owner through another channel, such as an email address, a support portal or the domain’s WHOIS contact. Cloudflare’s 1xxx page says only the website owner can contact Cloudflare for technical support.

- For an API you pay for, open a ticket with the provider and include the Ray ID. Zoom publishes its own [error code 1020 article](https://support.zoom.com/hc/en/article?id=zm_kb&sysparm_article=KB0083333), which describes it as a firewall block.

## Cause-to-fix table

| Cause | Diagnostic | Fix | Who acts |
| --- | --- | --- | --- |
| Proxy refused CONNECT | proxy=403 site=000, no Ray ID | Change the destination policy or ask the provider | Proxy operator |
| Proxy credentials missing or wrong | proxy=407, (56) ... response 407 | Correct and percent-encode the credentials | You |
| Proxy cannot reach the target | proxy=503; proxy log ERR_CONNECT_FAIL or ERR_DNS_FAIL | Fix host, port or the proxy’s DNS | You or proxy operator |
| Intercepting proxy, untrusted CA | curl: (60), ERR_CERT_AUTHORITY_INVALID | Trust the CA deliberately or get an inspection exception | You or IT |
| Origin’s own 403 | cf-cache-status present, site’s own body | The site’s application or server rules | Site owner |
| Challenge | cf-mitigated: challenge | Use a browser; owner can change the action | Visitor or owner |
| WAF block page | “Sorry, you have been blocked” with Ray ID | Owner adjusts the WAF rule | Site owner |
| Block rule, no custom response | error code: 1020, server: cloudflare | Owner finds the event by Ray ID and edits the rule | Site owner |
| Schema Validation violation | Diff request against the API’s OpenAPI spec, body size | Send a conforming request | You, then owner |
| JWT invalid, expired or missing | jwt_exp.py on the token; check header or cookie name | Refresh the token, send it where configured; owner exempts OPTIONS | You and owner |
| Rule on IP, ASN or country (proxy exit) | /cdn-cgi/trace through the same proxy | Ask the owner for access or an allowlist entry | Site owner |
| Rule on headers, HTTP version or TLS | Compare the failing and working requests on the wire | Use the client the API documents; report the difference | You and owner |

## Frequently asked questions

### What does error code 1020 mean?

A Cloudflare security feature set up by the website's owner blocked your request. Cloudflare sends it with HTTP status 403. API clients see the one-line body "error code: 1020"; browsers see an "Access denied" page with a Ray ID.

### Is error 1020 my fault?

Not necessarily. The owner's rule matched something about the request: the network it came from, the client, a token or the request body. Some of those you can fix, such as an expired token or a malformed request. The rest only the owner can change.

### Can a VPN or proxy cause error 1020?

Yes, when the owner's rule matches the exit's IP, ASN or country, or what an intercepting proxy does to the connection. A proxy's own failures look different: a 403, 407 or 503 to CONNECT, or a certificate error, all before Cloudflare is reached.

### Why do I get 1020 in curl or Python but not in my browser?

The rule probably matches something that differs between them, such as the user agent, other headers, the HTTP version or the TLS handshake. The owner's Security Events show which field matched. Use the site's API if it offers one, or ask the owner about automated access.

### How long does error 1020 last?

Cloudflare documents no expiry for it, unlike the 1015 rate-limit block. The rule is checked on every request, so the block lasts as long as your requests keep matching it.

### Why do I see "Sorry, you have been blocked" instead of 1020?

That is Cloudflare's WAF block page. Since Firewall Rules became WAF custom rules, requests blocked by custom or managed WAF rules get that page rather than a 1020. The fix is the same: send the owner the Ray ID.

### Is Zoom error code 1020 the same error?

Zoom's support article describes its error code 1020 as a firewall block. The 2022 developer forum thread shows the API returning Cloudflare's exact "error code: 1020" body, so at least that occurrence was a Cloudflare block.

## Sources

1. [Cloudflare Docs: Error 1020](https://developers.cloudflare.com/support/troubleshooting/http-status-codes/cloudflare-1xxx-errors/error-1020/)
2. [Cloudflare Docs: Cloudflare 1xxx errors (status code per error, support contact rule)](https://developers.cloudflare.com/support/troubleshooting/http-status-codes/cloudflare-1xxx-errors/)
3. [Cloudflare Docs: Firewall rules upgrade (1020 vs WAF block response, API unsupported since 2025-06-15)](https://developers.cloudflare.com/waf/reference/legacy/firewall-rules-upgrade/)
4. [Cloudflare Docs: Error page types](https://developers.cloudflare.com/rules/custom-errors/reference/error-page-types/)
5. [Cloudflare Docs: Custom error rule examples (cf.response.1xxx_code eq 1020)](https://developers.cloudflare.com/rules/custom-errors/example-rules/)
6. [Cloudflare Docs: Create a custom rule (custom block response, Pro plan and above)](https://developers.cloudflare.com/waf/custom-rules/create-dashboard/)
7. [Cloudflare Docs: Security Events (sampled logs, 500-event export)](https://developers.cloudflare.com/waf/analytics/security-events/)
8. [Cloudflare Docs: Cloudflare Ray ID](https://developers.cloudflare.com/fundamentals/reference/cloudflare-ray-id/)
9. [Cloudflare Docs: API Shield Schema Validation (body size limits by plan)](https://developers.cloudflare.com/api-shield/security/schema-validation/)
10. [Cloudflare Docs: API Shield JWT validation (missing tokens, OPTIONS preflight)](https://developers.cloudflare.com/api-shield/security/jwt-validation/)
11. [Cloudflare Docs: Detect a Challenge Page response (cf-mitigated)](https://developers.cloudflare.com/cloudflare-challenges/challenge-types/challenge-pages/detect-response/)
12. [Cloudflare Docs: Cloudflare cache responses (DYNAMIC)](https://developers.cloudflare.com/cache/concepts/cache-responses/)
13. [Cloudflare Docs: /cdn-cgi/ endpoint (/cdn-cgi/trace)](https://developers.cloudflare.com/fundamentals/reference/cdn-cgi-endpoint/)
14. [Cloudflare Docs: http.request.headers field](https://developers.cloudflare.com/ruleset-engine/rules-language/fields/reference/http.request.headers/)
15. [Cloudflare Docs: http.request.version field](https://developers.cloudflare.com/ruleset-engine/rules-language/fields/reference/http.request.version/)
16. [Cloudflare Docs: cf.bot_management.ja4 field (Enterprise Bot Management)](https://developers.cloudflare.com/ruleset-engine/rules-language/fields/reference/cf.bot_management.ja4/)
17. [Cloudflare Docs: Error 1005 (ASN banned)](https://developers.cloudflare.com/support/troubleshooting/http-status-codes/cloudflare-1xxx-errors/error-1005/)
18. [Cloudflare Docs: Errors 1006, 1007, 1008 or 1106](https://developers.cloudflare.com/support/troubleshooting/http-status-codes/cloudflare-1xxx-errors/error-1006/)
19. [Cloudflare Docs: Error 1009 (country or region banned)](https://developers.cloudflare.com/support/troubleshooting/http-status-codes/cloudflare-1xxx-errors/error-1009/)
20. [Cloudflare Docs: Error 1010 (browser signature)](https://developers.cloudflare.com/support/troubleshooting/http-status-codes/cloudflare-1xxx-errors/error-1010/)
21. [Cloudflare Docs: Error 1015 (rate limited)](https://developers.cloudflare.com/support/troubleshooting/http-status-codes/cloudflare-1xxx-errors/error-1015/)
22. [Cloudflare Docs: Zone Lockdown (error 1106)](https://developers.cloudflare.com/waf/tools/zone-lockdown/)
23. [curl manual: --write-out variables http_connect and http_code](https://curl.se/docs/manpage.html)
24. [curl-users: Re: Error 1020, Daniel Stenberg, 15 April 2021](https://curl.se/mail/archive-2021-04/0034.html)
25. [Zoom Developer Forum: Error Code 1020, with response headers, November 2022](https://devforum.zoom.us/t/error-code-1020/78374)
26. [Zoom Support: Error code 1020](https://support.zoom.com/hc/en/article?id=zm_kb&sysparm_article=KB0083333)
27. [OONI measurement recording a Cloudflare WAF block page, 19 August 2022](https://explorer.ooni.org/m/20220819190205.630557_KZ_webconnectivity_a5ab504c670058f1)
