404 Not Found
Diagnose a 404 Not Found by checking the URL, deleted files, broken routes, redirects, permalinks, and server configuration.
Troubleshoot nginx errors by checking upstream services, sockets, proxy_pass targets, PHP-FPM, timeouts, and server logs.
nginx can serve static files, pass requests to PHP-FPM, proxy to an app server, sit behind a CDN, or front multiple upstreams. A visible nginx error is a clue, not a complete diagnosis. Start with the error log, then match it to the configured server block, location, upstream, socket, or proxy_pass target.
| Symptom | Likely issue | Next path |
|---|---|---|
connect() failed | Upstream service or socket unavailable | Verify upstreams and sockets |
upstream timed out | Slow app, overloaded backend, or timeout mismatch | nginx 502 |
| 502 only behind CDN | CDN-to-origin or origin proxy issue | Trace 502 layers |
| 404 on static assets | Root, alias, rewrite, or deploy path issue | 404 Not Found |
nginx -t
systemctl status nginx
systemctl status php-fpm
curl -I http://127.0.0.1:3000/
Run config validation before reloads. If a production service is managed by a panel, container orchestrator, or host, use the equivalent health screen rather than restarting blindly.
For changes to server blocks, upstream names, sockets, or proxy_pass, keep the previous file and reload only after nginx -t succeeds. Escalate with the exact log phrase, upstream target, changed config file, and timestamp.
proxy_pass sends HTTP traffic to another service. fastcgi_pass sends PHP requests to PHP-FPM. A named upstream block can hold multiple backends. A Unix socket is a local file-like endpoint, while a TCP upstream uses host and port. When a route breaks, verify the exact directive used by that location block rather than assuming every nginx 502 is PHP-FPM.
Do not increase timeouts before you know whether the upstream is reachable. Longer timeouts can hide an outage and make users wait longer. Confirm service health, socket path, port, and logs first, then adjust timeout settings only when the upstream is healthy but legitimately slow.
Diagnose a 404 Not Found by checking the URL, deleted files, broken routes, redirects, permalinks, and server configuration.
Diagnose a 502 Bad Gateway by checking the proxy, CDN, upstream app, PHP-FPM, timeouts, and server logs before changing DNS.
Fix nginx 502 errors by checking upstream health, sockets, proxypass targets, PHP-FPM, timeouts, and nginx error logs.
Troubleshoot a WordPress 502 by checking PHP-FPM, overloaded plugins, theme changes, cache/CDN layers, hosting limits, and logs.
Learn how to inspect access logs, error logs, status codes, timestamps, upstream failures, and recent changes during HTTP outages.
Use a safe rollback workflow for website errors by preserving evidence, restoring the smallest change, and verifying recovery.
Repair redirects, permalink rules, rewrite configuration, and route mismatches that cause 404s or redirect loops after site changes.
Trace a 502 Bad Gateway across browser, CDN, reverse proxy, origin server, upstream app, and logs to find the failing layer.
Check nginx upstream definitions, Unix sockets, proxypass targets, service health, permissions, and logs when nginx returns 502.