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.
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.
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/*
curl -i -sS -A 'Mozilla/5.0' https://example.com/protected-route
Check Security > Events in the Cloudflare dashboard by Ray ID. Whitelist the caller IP or add a WAF Skip rule for verified webhook paths.
When the IAM role lacks `s3:ListBucket` permission, S3 intentionally returns 403 AccessDenied for non-existent keys to avoid leaking object existence.
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.