What the message looks like
2026/10/29 09:41:03 [error] 1234#1234: *7788 open() "/var/www/example.com/html/about" failed (2: No such file or directory), client: 203.0.113.5, server: example.com, request: "GET /about HTTP/2.0", host: "example.com"Common causes
- The
rootoraliaspoints to the wrong directory, or the deployment did not put the files there. - An application with pretty URLs (front controller, single-page app) lacks
try_files ... /index.php?$argsor/index.html. - The request reached the wrong
serverblock (wrongserver_nameor thedefault_server). - File names are case-sensitive on Linux:
Logo.PNGis notlogo.png. - A
locationwithaliashas a trailing-slash mismatch, or a regex location overrides the intended one.
Check
- The exact path nginx tried
sudo tail -n 20 /var/log/nginx/error.log - The effective rules of the server
nginx -T 2>/dev/null | grep -nE 'server_name|root |alias |try_files|location ' - Does the file exist at that path?
ls -l /var/www/example.com/html/about - Which server block answers this host? (check the response)
curl -sI -H 'Host: example.com' http://127.0.0.1/about | head -n 5
Fix
- Compare the path from the error log with the real file location and correct
rootoralias, or deploy the missing files. - For front-controller apps use
location / { try_files $uri $uri/ /index.php?$args; }, for single-page appstry_files $uri /index.html;. - Check
server_nameso that the host matches the intended block, and set a deliberatedefault_server. - Fix the case of file names or links, and with
aliasmake the location and alias slashes match. - Test and apply:
nginx -t && systemctl reload nginx.
FAQ
How is a 404 different from 403?
404 means nginx found no matching file. 403 means it found the path but may not read it or may not list the directory, which is a permission or index problem.
Can a 404 come from the application and not from nginx?
Yes. If PHP-FPM or a proxy backend answers 404, nginx only passes it on. The error log has no open() failed line in that case, so check the application routing.