HTTP 403 Forbidden means the server understood your request and refused to authorize it. Visitors usually hit it after a missing login, a blocked IP or VPN, or a security rule. Site owners and scraper operators should read the response headers first to see whether the origin, a CDN, a WAF, or their own proxy sent it.
That last case is the one most guides skip. When you scrape, monitor retail stock, or run checkout automation through proxies, a 403 can come from four different systems, and each needs a different fix. This guide covers the quick visitor fixes, then spends most of its time on finding the layer that said no and fixing automated traffic without making the block worse.

Quick answer: how to fix HTTP 403 Forbidden
Start with the row that matches your situation:
| Situation | Best first step |
|---|---|
| You are a normal visitor | Log in, clear site cookies, turn off VPNs and privacy extensions, try another network |
| You own the website | Check server logs, file permissions, .htaccess or Nginx deny rules, and WAF events |
| You are calling an API | Verify the token scope, account role, request method, and IP allowlist |
| Your scraper gets 403 on every request | Check headers, TLS fingerprint, and whether the site serves a challenge page |
| Only proxy traffic gets 403 | Run the same request without the proxy, then check whether the proxy or the site refused it |
| The 403 starts after a few hundred good requests | Treat it as rate or behavior blocking, not a permissions problem |
What is HTTP 403 Forbidden?
HTTP 403 Forbidden is a 4xx client error status code. RFC 9110, section 15.5.4 defines it:
The 403 (Forbidden) status code indicates that the server understood the request but refuses to fulfill it. A server that wishes to make public why the request has been forbidden can describe that reason in the response content (if any).
MDN puts it the same way: the server understood the request but refuses to authorize it.
The RFC adds three details that matter in practice:
- If you sent credentials, the server considers them insufficient. The client should not repeat the request with the same credentials.
- A request can be forbidden for reasons that have nothing to do with credentials, such as IP, country, or a WAF rule.
- A server that wants to hide that a resource exists may return 404 Not Found instead of 403.
You may see a 403 as 403 Forbidden, Access denied, You don't have permission to access this resource, a Cloudflare or Akamai block page, or a JSON error such as insufficient_scope. In every form, the request reached a system that made an access decision and said no. It is not a timeout or an outage.
Find which layer sent the 403
The fix depends on who refused the request. Check the response headers first:
curl -sI https://example.com/blocked/path
| Header clue | Likely source |
|---|---|
cf-mitigated: challenge |
Cloudflare challenge page. A browser can pass it, a plain HTTP client cannot |
server: cloudflare and a cf-ray header, no cf-mitigated |
Cloudflare WAF, custom rule, or IP access rule such as 1005 or 1020 |
x-amz-cf-id, or x-cache: Error from cloudfront |
Amazon CloudFront or AWS WAF |
server: AkamaiGHost |
Akamai |
server: nginx or server: Apache with a plain error page |
The origin web server: permissions, missing index file, or deny rules |
| JSON body with an error code | The application or API gateway: role, scope, or plan |
Cloudflare documents the cf-mitigated header as the supported way to detect a challenge response. As of October 2026, challenge is its only valid value, and a challenge always comes back as text/html, whatever resource you requested.
In a browser, open DevTools, go to the Network tab, select the failed request, and read the response headers. To compare a working session with a failing one, export both as HAR files and load them in the HAR analyzer.
When the proxy itself returns 403
If you send HTTPS traffic through an HTTP proxy, your client first asks the proxy to open a tunnel with CONNECT. A proxy that refuses the tunnel answers with its own 403, and the target site never sees the request.
The error text gives it away:
- Python
requestsraisesProxyErrorwithTunnel connection failed: 403 Forbidden. - curl exits with code 56 and reports that the proxy returned 403 to the
CONNECTrequest. Runcurl -vto see the proxy's response headers.
Common causes are a proxy that only allows CONNECT to port 443, a destination blocked by the proxy's policy, a corporate or hosting-provider proxy picked up from HTTPS_PROXY without you noticing, or an IP allowlist on the proxy that does not include your server. A wrong username or password usually returns 407 Proxy Authentication Required instead. If an environment proxy is the culprit, the Python Requests no-proxy guide shows how to bypass it with NO_PROXY or trust_env.
A script that classifies the 403
This Python script makes one request, separates a proxy refusal from a site refusal, and labels the layer from the headers. It uses requests, which you can install with pip install requests.
import requests
URL = "https://example.com/blocked/path"
PROXY = None # e.g. "http://user:pass@proxy.example.com:8080"
def classify_403(resp: requests.Response) -> str:
h = resp.headers # case-insensitive
if h.get("cf-mitigated") == "challenge":
return "Cloudflare challenge page"
if "cf-ray" in h:
return "Cloudflare rule or block"
if "x-amz-cf-id" in h:
return "CloudFront or AWS WAF"
if h.get("server", "").startswith("AkamaiGHost"):
return "Akamai"
if "application/json" in h.get("content-type", ""):
return "Application or API: " + resp.text[:200]
return "Origin server or app: " + h.get("server", "unknown")
proxies = {"http": PROXY, "https": PROXY} if PROXY else None
try:
resp = requests.get(URL, proxies=proxies, timeout=20)
except requests.exceptions.ProxyError as exc:
print("The proxy refused the request, not the site:", exc)
else:
print(resp.status_code)
if resp.status_code == 403:
print(classify_403(resp))
Run it once with PROXY = None and once with your proxy. If the direct run passes and the proxy run fails, you have narrowed the problem to the route. If both fail with the same label, the request itself is the problem.
HTTP 403 vs. 401 vs. 429 vs. Cloudflare errors
Different access and rate errors point to different fixes.
| Code or error | Meaning | Best first diagnosis |
|---|---|---|
| HTTP 401 | Authentication required or invalid | Check login, token, API key, or credential format |
| HTTP 403 | Access is forbidden | Check permissions, policy, WAF, IP rules, and auth scopes |
| 407 | The proxy wants credentials | Check proxy username, password, and auth format |
| HTTP 429 | Too many requests | Reduce rate, add backoff, and lower concurrency |
| Cloudflare 1015 | Cloudflare rate limit triggered | Fix request pacing and per-IP request concentration |
| Cloudflare 1005 | ASN banned by the site owner | Check Cloudflare IP Access Rules and the visitor's network |
| Cloudflare 1020 | Cloudflare firewall rule denied access | Check WAF rules, request profile, location, and IP reputation |
If the user is not authenticated, the right response is usually 401. If the user is authenticated but lacks permission, 403 fits. Some sites send 403 for rate limits instead of 429, so if a slower run succeeds, treat it as a rate limit. Cloudflare's 1005 and 1020 pages are served with a 403 status, so a Cloudflare-branded 403 points to the site's Cloudflare rules, not to the origin.
Why HTTP 403 happens
A 403 means some access check refused the request. That check can live in the application, the web server, the CDN, the WAF, an API gateway, or a proxy between you and the site. The usual triggers are a missing login or role, a token without the right scope, a blocked IP, ASN, or country, a WAF or bot rule, wrong file permissions, failed hotlink or CSRF checks, and missing cookies. Some sites also send 403 for rate limits.
For proxy and scraping work, the common mistake is treating every 403 as an IP problem. IP reputation matters. A bad token, a missing cookie, the wrong method, a Python TLS fingerprint, or a forbidden use case produces the same status, and a new IP fixes none of them.
How to fix HTTP 403 as a website visitor
If you are browsing normally:
- Check the URL and refresh once. Use a hard refresh, Ctrl+F5 on Windows or Cmd+Shift+R on Mac, to skip the cache.
- Log in, or switch to the account that should have access.
- Clear cookies for that site, or try a private window.
- Turn off VPNs, public proxies, and extensions that block scripts or change requests.
- Try another network, such as mobile data instead of school, work, or shared Wi-Fi.
- Contact the site owner if you should have access.
Do not keep refreshing. If the 403 comes from abuse controls, repeated retries can make your session or IP look worse.
In our test, Ticketmaster returned an HTTP 403 page titled "Let's Get Your Identity Verified." Our Ticketmaster unusual activity guide covers what to do if you see it.
How to fix HTTP 403 as a website owner
Find the layer first, then change one thing. Check web server and application logs for the blocked path, CDN and WAF security events, and any deploy that changed middleware, routes, or access rules.
For static files and classic hosting, a 403 usually comes from one of these:
- File permissions. The web server user must be able to read files and enter directories. Common settings are
644for files and755for directories. Never set777to make a 403 go away. It opens the files to every user on the server. - Missing index file. With directory listing off, a request for a folder that has no
index.htmlorindex.phpreturns 403. Nginx logsdirectory index of "/var/www/html/" is forbidden. Apache returns 403 whenOptions -Indexesis set and no index file exists. - Deny rules. Check
.htaccessand server config forRequire all denied,Deny from, or Nginxdenylines. On Apache, renaming.htaccesstemporarily tells you fast whether it is the cause. - WordPress security plugins. Login lockouts and firewall plugins block IPs and paths on their own. Disable them one at a time to find the one returning 403.
- SELinux. On RHEL-based systems, files with the wrong security context return 403 even with correct permissions.
restorecon -Rv /var/www/htmlresets the default context.
If a WAF rule blocks real users, add a scoped exception for the path and signal involved. Do not disable the whole security layer because one route is misconfigured.
Watch what you send to search engines too. Google's documentation on HTTP status codes and crawling says it does not index URLs that return 4xx codes and removes already indexed ones over time. It also says not to use 401 or 403 to limit crawl rate. A bot rule that sends Googlebot a 403 can drop public pages from search.
How to fix HTTP 403 for APIs
For APIs, 403 usually means "we know who you are, but you cannot do this action." A missing or invalid token should return 401.
Check that the token is in the expected header, has not expired, and carries the required scopes. Then check the account or organization ID, the HTTP method, and whether the endpoint is on your plan. Many APIs also pin keys to an IP allowlist, so a request from a new server or proxy gets 403 with a valid key.
Log the full error body. The JSON next to the 403 usually names the missing scope, the plan limit, or the allowlist rule.
How to fix HTTP 403 when scraping
Before you change anything, confirm the target permits your use case and that you are following its terms and the law. Then work out when the 403 appears, because timing tells you more than the status code does.
| When the 403 appears | Likely cause | First test |
|---|---|---|
| On the first request, every time | Headers, TLS fingerprint, blocked IP range, or a challenge page | Compare with a real browser request, check cf-mitigated |
| After a run of successful requests | Rate, burst, or behavior scoring | Slow down by half and see if the cutoff moves |
| Only on login, cart, or checkout paths | Endpoint-level policy, missing session or CSRF token | Replay the browser flow in order with the same cookies |
| Only through the proxy | Proxy refusal, IP reputation, ASN, or region | Run the classifier script direct and through the proxy |
If the failing client is Scrapy, the Scrapy 403 diagnostic workflow covers inspecting the filtered response and controlling retries.

Headers and sessions
A default Python, Node, or Go user agent gets blocked on many sites before anything else is checked. Send a full, consistent header set for the browser you claim to be. The web scraping headers guide has a minimal baseline and a controlled way to test which header matters.
Sessions matter just as much. Many sites set cookies on the first page view and refuse deeper pages that arrive without them. Use one session object per identity, load the entry page first, and keep the user agent, language, and IP stable for the life of that session.
TLS fingerprinting
If your headers match Chrome exactly and you still get 403 on the first request, look at the TLS handshake. Python requests uses OpenSSL, and its Client Hello lists different cipher suites and extensions from Chrome's BoringSSL. Bot-management systems compare that fingerprint, often as a JA3 or JA4 hash, against the user agent. A Chrome user agent on a Python handshake looks fake.
curl_cffi sends a browser-like handshake. As of October 2026, its docs list chrome as an alias that tracks the latest supported Chrome profile. Install it with pip install curl_cffi and compare fingerprints:
from curl_cffi import requests
proxy = "http://user:pass@proxy.example.com:8080"
r = requests.get(
"https://tls.peet.ws/api/clean",
impersonate="chrome",
proxies={"http": proxy, "https": proxy},
timeout=20,
)
print(r.json()) # ja3, ja4, and HTTP/2 fingerprint values
Run the same URL with plain requests and compare the output. If the target accepts the curl_cffi request and rejects the requests one from the same IP, the fingerprint was your 403.
Challenge pages and JavaScript checks
A 403 with cf-mitigated: challenge, or a body that says "Just a moment", means the site wants the client to run JavaScript. No header or proxy change gets an HTTP client past that. You need a real browser, driven by Playwright, Puppeteer, or Selenium, that loads the page and keeps the resulting cookies. The Playwright proxy guide shows how to attach a proxy per browser context so each session keeps one IP. A browser is not a guaranteed pass, though. In our Cloudflare Bot Fight Mode test, headless Chromium on a datacenter IP cleared none of the managed challenges it met within 20 seconds.
Rate and behavior blocks
A 403 that appears after a few hundred clean requests is usually a rate or behavior decision with the wrong status code. Cut concurrency, add random jitter between requests, and stop the worker for a few minutes after a 403 instead of retrying in a loop. Log blocks by proxy, endpoint, method, and session so you can see whether one IP or one path triggers them.
When proxies help with HTTP 403
Proxies help when the denial is tied to the IP. That covers flagged datacenter ranges, overused public proxies, country or ASN rules, and too much traffic concentrated on one address. They do not fix missing permissions, a bad token, a Python TLS fingerprint, or a challenge page that needs JavaScript.
To prove the IP is the cause, run a controlled test. Keep the URL, headers, cookies, client, and rate identical and change only the route. Copy your real browser's user agent from the user agent checker so both runs send the same one:
UA="PASTE_YOUR_BROWSER_USER_AGENT"
URL="https://example.com/page"
# Direct
curl -s -o /dev/null -w "direct: %{http_code}\n" -A "$UA" "$URL"
# Through the proxy
curl -s -o /dev/null -w "proxy: %{http_code}\n" -A "$UA" \
-x "http://user:pass@proxy.example.com:8080" "$URL"
If direct returns 200 and the proxy returns 403, the route is the problem. If both return 403, fix the request first. Adding more IPs to a request the site rejects on sight only burns through them faster.
Residential vs. ISP proxies for 403 errors
Pick the proxy type based on what the site checks:
| Proxy type | Best for | Why it can help with 403 |
|---|---|---|
| Residential proxies | Rotating scraping, geo testing, location-sensitive pages | Consumer IPs from many locations, harder to block as a range |
| ISP proxies | Retail monitoring, ticketing, account and checkout sessions | Static IPs that keep one identity for the whole session |
| Datacenter proxies | Permissive targets and high-volume low-cost requests | Fast, but strict sites often block whole datacenter ASNs |
Retail and ticketing sites often tie a cart, queue position, or login to the IP that started it. If a rotating pool hands you a new IP mid-session, the next request can come back 403 even though the session cookie is valid. Use sticky sessions or static ISP proxies for those flows. The sticky vs. rotating proxies guide explains when each fits. If you need to reformat proxy lists between tools, use the proxy converter.
How to prevent HTTP 403 in automation workflows
- Keep one IP, user agent, and cookie jar per session for login, cart, and checkout flows.
- Track 403 rates by endpoint and proxy, and pull proxies that keep failing out of rotation.
- Keep public page monitoring separate from account endpoints, so a block on one does not take down the other.
- Respect robots guidance, site terms, API rules, and account permissions.
FAQ
What does HTTP 403 Forbidden mean?
HTTP 403 Forbidden means the server understood the request but refused access. The denial can come from the application, the web server, a CDN, a WAF, an API gateway, or a proxy in front of you.
What is the difference between 401 and 403?
401 Unauthorized means the server needs valid authentication and did not get it, so logging in can fix it. 403 Forbidden means the server knows enough to decide and the answer is no. Fixing a 403 takes different permissions, a different account, or a change to the rule that blocks you.
Is a 403 error my fault?
Not usually. As a visitor, a 403 reflects the site's own access rules, though a VPN, an extension, or stale cookies can trigger them. As a site owner, most 403s come from your own permissions, rules, or security settings, which means you can fix them.
Why does my Python request get 403 when the browser works?
The browser sends a full header set, keeps cookies, runs JavaScript, and has a Chrome TLS fingerprint. Python requests does none of that by default. Match the headers first, then test with curl_cffi for the fingerprint, and switch to a real browser if the site serves a challenge page.
Why do I get 403 only when using a proxy?
Either the proxy refused the tunnel, which shows up as a ProxyError or a curl exit code 56, or the site blocks the proxy's IP, ASN, or region. Run the same request directly and through the proxy to tell the two apart.
Can a 403 error hurt SEO?
Yes, if Googlebot gets it on pages you want indexed. Google's documentation says it removes URLs that keep returning 4xx codes from its index and that 401 and 403 should not be used to slow crawling. Check bot and firewall rules for search engine crawlers.
Should I retry after a 403?
Not in a tight loop. Work out whether the cause is permissions, authentication, a WAF rule, or the IP first. Fast repeated retries make rate and abuse systems more likely to keep blocking you.
Final thoughts
Read the headers before you touch anything. A cf-mitigated header needs a real browser, a ProxyError needs a proxy fix, and a JSON scope error needs a different token. Rotating IPs faster fixes none of them. For scrapers, run the direct-versus-proxy test once and the classifier on every 403 you log. Then fix the request, the session, or the route in that order.