HTTP 403 · 4XX RFC 9110 §15.5.4 Cacheable: No Retryable: No (permission/WAF issue)

HTTP 403 Forbidden: Root Causes & Production Fix Guide

HTTP 403 Forbidden means the server understood your request and refused to fulfill it. In modern cloud stacks, 403 is most often triggered by Cloudflare WAF rules, AWS S3 bucket policies, Nginx file permissions, or missing index files.

Top Root Causes of HTTP 403

Nginx Index & Permission Check + Cloudflare WAF Audit

server {
    root /var/www/site/dist;
    index index.html;
    location / {
        try_files $uri $uri/ =404;
    }
}
# Ensure nginx worker user can traverse directories:
# chmod 755 /var/www/site/dist && chmod 644 /var/www/site/dist/*

Verify with cURL

curl -i -sS -A 'Mozilla/5.0' https://example.com/protected-route

Interactive Stack Diagnoser (HTTP 403)

Frequently Asked Questions

Why does Cloudflare return 403 to my webhook or API client?

Check Security > Events in the Cloudflare dashboard by Ray ID. Whitelist the caller IP or add a WAF Skip rule for verified webhook paths.

Why does AWS S3 return 403 instead of 404 for missing files?

When the IAM role lacks `s3:ListBucket` permission, S3 intentionally returns 403 AccessDenied for non-existent keys to avoid leaking object existence.

How do I fix Nginx 403 Forbidden on a static site?

Verify `root` points to the right folder, `index index.html;` is set, and every parent directory has execute (`+x`) permission for the `www-data`/`nginx` user.

Related Status Guides & Header Tools