Skip to content

Troubleshooting guide

403 Forbidden: what it means and how to fix it

A 403 means the server understood who is asking, or decided it does not matter, and refuses anyway. The cause is a rule somewhere on the path: file permissions, a firewall, a bot filter or a permission check.

4 min read10 sectionsUpdated

On this page

Key points

  • 403 = refused. Unlike 401, logging in again usually does not help.
  • Web servers return 403 for unreadable files and for directories without an index file.
  • WAFs and bot protection return 403 to clients they classify as automated, including monitoring tools.
  • APIs return 403 when the key or token lacks the required permission or scope.

403 vs 401

401 Unauthorized means "who are you?": no credentials, or invalid ones. 403 Forbidden means "I know, and the answer is no": the credentials are fine but not allowed to do this, or the server refuses for another reason such as a firewall rule. Some servers return 404 instead of 403 on purpose, to avoid revealing that a resource exists.

On a web server

bash
# can the web server user read the file and enter every directory on the path?
namei -l /var/www/example.com/index.html
# nginx usually runs as www-data or nginx
ps -o user= -C nginx | sort -u
# fix ownership and permissions (adjust to your setup)
sudo chown -R www-data:www-data /var/www/example.com
sudo find /var/www/example.com -type d -exec chmod 755 {} \;
sudo find /var/www/example.com -type f -exec chmod 644 {} \;
CauseSignFix
File not readable by the server user"permission denied" in the error logFix ownership and permissions on the file and every parent directory
Directory without an index file"directory index of ... is forbidden"Add index.html, or set the index directive; do not enable directory listing
Deny rulesA deny/allow block or .htaccess rule matchesRemove or narrow the rule
SELinux or AppArmorPermissions look right but access failsCheck audit logs and set the right security context

At a CDN, WAF or bot filter

Firewalls and bot protection return 403 when a request matches a rule: a country block, an IP reputation list, a rate rule, or a bot score. Two common surprises:

  • Your own monitoring gets blocked. Uptime checks and synthetic tests are automated by nature. Allow their source addresses or user agent, or add a rule that skips bot checks for a health URL.
  • Search engine crawlers get blocked by an aggressive rule. Check the firewall's event log for blocked crawler requests; verified crawlers should be allowed.

In an API or cloud storage

  • Missing permission or scope: the token is valid but lacks the role or scope. The response body often names it.
  • Expired or tampered signed URLs for object storage return 403.
  • Bucket or object policies that do not allow public or cross-account reads.
  • IP allowlists on the API key or the account.

Catch it automatically

A 403 on a page that should be public is an outage for those visitors even though the server is up. Point an uptime check at the important public URLs and alert on any status other than 200, and keep the check's source addresses allowed in your firewall so a new rule does not silence it.

Frequently asked questions

Is 403 a server problem or my problem?

It is a 4xx code: the server refuses this request. As a visitor you can try logging in with an account that has access, disabling a VPN, or contacting the site; the fix is usually on the server side.

Why do I get 403 only from a script or tool?

Bot protection often blocks requests without a normal browser fingerprint, or from data center addresses. Use an allowed user agent or address, or ask the site owner to allow your tool.

Should a missing page return 403?

No. Missing pages should return 404. Use 403 for content that exists but is not allowed for this caller.

Check it now, free

Watch your own site and services with VitalRix

Uptime checks, APM, logs, real-user monitoring, alerts and status pages in one place. Every product has a free tier and no credit card is needed.