Nginx 403 Forbidden: stat() failed (13: Permission denied)

Nginx worker user (`www-data`) lacks execute (`+x`) traversal bit on a parent directory.

Runs locally in browser Free · No login Independently Verified 2026-11-25 v4.1.0
Identifier: Nginx 403 Forbidden Platform: Nginx
Common Root Causes:
  • Nginx worker user (`www-data`) lacks execute (`+x`) traversal bit on a parent directory.

Interactive Diagnostic Checklist

Verified Solutions:
  1. Grant `chmod o+rx` on parent directories (or `chgrp www-data`) without making files world-writable.
Safe Diagnostic Command:
namei -om /var/www/site/index.html
Warning: Verify configuration changes in staging or with dry-run flags (e.g. nginx -t) before reloading production services.

Technical Explanation

Nginx worker user (`www-data`) lacks execute (`+x`) traversal bit on a parent directory. Recommended diagnostic: `namei -om /var/www/site/index.html`. Remediation: Grant `chmod o+rx` on parent directories (or `chgrp www-data`) without making files world-writable.

Worked Examples

  • Run `namei -om /var/www/site/index.html` to verify root cause before applying the remediation.

Limitations & Assumptions

  • Always verify configuration changes in staging or with dry-run flags (e.g. `nginx -t`) before reloading production services.

Source References & Verification

Resource ID: err-nginx-permission-denied-static-403 · Independently verified: 2026-11-25

Related Resources