Errors / HTTP errors
403 Forbidden nginx
nginx found the path but is not allowed to serve it.
Everyone gets the 403 for that path.
Seeing it on someone else’s site?
- The site's server is refusing this page; it is a configuration problem on their side.
Why it happens, if it is your site
directory index of "/var/www/…/" is forbidden: a folder with noindex.html/index.php, andautoindexoff.open() "…" failed (13: Permission denied): the nginx user cannot read the file, or cannot traverse one of the parent folders.- A
deny all;in alocationblock, or anallowlist that does not include the visitor. - On RHEL-family systems, SELinux blocking nginx from files outside its expected folders.
How to fix it
- Read the error log line: it says which of these it is.
- Add the index file, or the right
indexdirective, for that folder. - Give the nginx user read on files and execute on every parent folder (
namei -l /path/to/fileshows where it breaks). - With SELinux, set the right context (
chcon -R -t httpd_sys_content_t) instead of disabling it.
Whose problem it is
Usually the server that answers the request.
Does your site have it?
Free, no account. We open your page and four more in a clean Chrome and list every error like this one, with the page and the click that caused it. How the free page check works.
Often seen with
- 403 ForbiddenThe server understood the request and refuses to let you see this.
- 404 Not Found (nginx)nginx looked for the page on disk, where the configuration says, and it is not there.
- 502 Bad Gateway (nginx)nginx is running, but the application it passes requests to did not answer properly.