Skip to content

403 Forbidden: what it means and how to fix it

By the ProxyOnly team · 16 Nov 2026 · 6 min read

A 403 means the server understood your request and refuses it. The common causes, and how to fix them as a visitor, a site owner or a script.

A 403 Forbidden means that the server understood your request and refuses to carry it out. RFC 9110 adds that a server may explain why in the response body, and that if you sent credentials, the server considers them insufficient. Unlike a 401, a 403 is not a request to log in. See 401 Unauthorized vs 403 Forbidden for the difference.

The trouble with a 403 is that many different layers can produce it, and the status code does not say which one did. The first job is to find who said no.

Find out which layer refused you

A request can be refused by the web server's own rules, by the application, or by a firewall or CDN in front of both. Each leaves clues:

  • The page. A block page from a CDN or firewall usually names the product and shows a reference number, such as a Ray ID on Cloudflare. A plain page that says "Forbidden" with a server name at the bottom comes from the web server. A styled error inside the site's own design comes from the application.
  • The headers. curl -sI prints them. A site served through Cloudflare shows server: cloudflare and a cf-ray value. We ran curl -sI https://www.iana.org/ | grep -i -E '^(server|cf-ray):' and it printed server: cloudflare and a cf-ray line.
  • The server's error log, if you own the server. The log line says why the request was refused.

Common causes

On the web server:

  • A folder without an index file, with directory listings turned off. nginx logs directory index of "/var/www/site/" is forbidden.
  • File or folder permissions. The account the web server runs as cannot read the file, or cannot enter one of the folders above it. nginx logs open() "/path" failed (13: Permission denied).
  • A security label on systems that use SELinux. A file can look readable and still be refused because its label is wrong.
  • An access rule in the server configuration or in a .htaccess file, such as Require all denied. Apache logs client denied by server configuration.
  • A document root or index file name that does not match what the server expects.

In the application:

  • Your account does not have the role that the page needs, or the item belongs to someone else.
  • A form was sent without a valid anti-forgery token. Some frameworks answer these with a 403.
  • A signed link has expired or has been changed, which is common with links to files in cloud storage.

In a firewall, CDN or security plugin:

  • Your IP address, your country or the type of network you are on is blocked, or allowed only for others.
  • A rule matched the content of your request. A form field with characters that look like an attack can trigger a 403 from a web application firewall.
  • Bot protection decided that the client does not look like a browser, or that it sends requests too fast.
  • Hotlink protection refused an image or file that was requested from another site's page.
  • A site that blocks addresses of known proxy services, VPNs or hosting providers.

If you are a visitor

  1. Check the address. A typo, a missing trailing slash or an old link can land on a folder you may not open.
  2. Log in if the page is meant for members, and make sure you use the right account.
  3. Reload, and then clear the cookies for that site. An expired or damaged session cookie can cause a 403.
  4. Turn off a VPN or proxy and try again, and then try from another network, such as a phone. If one of them works, an address rule is the likely cause. See 403 Forbidden when using a proxy.
  5. Tell the site's owner. Include the page, the time, any reference number from the error page and your public IP address. The what is my IP tool shows it.

If you run the site

  1. Read the error log first. The causes listed above leave different messages, and the right fix depends on which one you see.
  2. For file permissions on Linux, namei -l /var/www/site/index.html lists the owner and permissions of every folder on the way to the file. The web server's user needs permission to enter each folder and read the file. Files are commonly 644 and folders 755. Do not "fix" a 403 with chmod 777, because that gives every account on the machine write access to your site.
  3. Check that the folder has an index file, or turn on listings on purpose if you want them.
  4. Look for deny rules in the server configuration, in .htaccess files and in security plugins, including ones that were added by an update.
  5. On a system with SELinux, check the file's label with ls -Z and restore it with restorecon if it is wrong.
  6. If a CDN or firewall sits in front, open its security events log and search for the visitor's address or reference number. It shows which rule blocked the request, and you can then adjust or exempt it.
  7. Test from outside your own network, because rules that depend on an address behave differently for you than for visitors.

If a script gets a 403

A 403 in a script is a refusal, and often a deliberate one. Start with the questions that decide whether you should continue at all: does the site allow automated access in its terms and its robots.txt, and does it offer an API or a data feed that you could use instead? Is web scraping legal covers the legal side.

If the answers are fine, find out what differs between your request and the one a browser makes:

  • Does the same URL load in a browser on the same network? If yes, the site treats the two clients differently, and the cause is usually headers, request rate or the type of network. Why websites block IPs and proxies lists the signals.
  • Identify your client honestly with a descriptive User-Agent that names your tool and points to a page with a way to contact you, and send headers that agree with each other.
  • Slow down, and keep one identity for one task instead of changing it in the middle of a session. The guides on 403 and 429 errors when scraping and avoiding blocks responsibly go through this step by step.
  • If the site is simply not for automated access, ask the owner for permission or an API key. That is a legitimate way to get a 403 turned into a 200.

If the 403 only appears through a proxy, check whether your own proxy credentials or allow list are right, and whether the site blocks that kind of address. Choosing the right proxy type explains how the type of network changes the odds. A proxy that asks for credentials itself answers with a 407, not a 403. See 407 Proxy Authentication Required.

  • 401 Unauthorized: you need to present valid credentials.
  • 404 Not Found: the page is not there, or the server does not want to say whether a forbidden page exists. The standard allows a server to use 404 for that.
  • 429 Too Many Requests: you are sending too many requests. See 429 Too Many Requests.
  • 502, 503 and 504: the problem is behind the server and not in your request. See 502 Bad Gateway.
  • Cloudflare error 1010: a Cloudflare rule refused your client. See Cloudflare error 1010.

Try it yourself

Create an account, add funds from US$1 and order a proxy in the country you need.

Keep reading