Nginx 403 Forbidden Fix

A 403 from Nginx means the server understood the URL but refused to serve it. Start with root, index and permissions.

Symptoms

  • Nginx returns 403 for a page or static asset.
  • Error log mentions permission denied or directory index forbidden.
  • Only one directory or deployed release fails.

Likely causes

  • Document root points to the wrong directory.
  • index directive misses the real entry file.
  • File ownership or permissions block the Nginx worker.
  • A deny rule or location block matches unexpectedly.

Fix steps

  1. Check root and index directives.
  2. Inspect file permissions up the full directory path.
  3. Review location matching order.
  4. Avoid chmod 777 and fix ownership deliberately.

Verify the fix

  • Run nginx -t.
  • Use namei -l on the file path when available.
  • Request the exact asset with curl -I.

FAQ

Should I enable autoindex?

Usually no. Fix the index file or route instead of listing directories publicly.

Is 403 the same as 404?

No. 403 means access is denied; 404 means the server is not serving that resource.

Related tools and guides

Last updated: May 18, 2026