Troubleshoot a 403 from Nginx
Updated August 29, 2026
A 403 response means Nginx understood the request but refused access. Check the error log and the active server block before changing permissions:
sudo tail -n 50 /var/log/nginx/error.log
sudo nginx -T | less
Common causes include a root pointing at the wrong directory, missing read/execute permission on a parent directory, a deny rule, an index file that is absent while directory listing is disabled, or a location block that matches unexpectedly. Confirm the requested path and the server_name selected by the request.
The Nginx worker user needs to traverse directories and read public files, but do not solve the problem with chmod -R 777. Set an appropriate owner/group and restrictive modes. SELinux or AppArmor can also deny access on distributions that use them; check their audit logs. Test every config change with sudo nginx -t and reload only after it passes. Never enable directory listing or expose private application files just to remove a 403.
Sources
related.
Ruslan Osipov
About the author