SECURITY WARNING: Never run commands you don't understand. Always review code before execution. Use at your own risk.
WebServer 10 errors

Web Server Errors

nginx, Apache, IIS and Caddy: binding, permissions, rewrites and TLS.

Understanding WebServer errors

Web server errors are usually about permissions, binding, or configuration that was never loaded. A common trap: the server runs as an unprivileged user (www-data, nginx), so it needs execute permission on every directory in the path to a file, not just read permission on the file itself. Another: editing a config file changes nothing until the server is reloaded and the file is actually included.

How to debug WebServer errors

  1. Validate configuration before reloading: nginx -t, apachectl configtest, caddy validate. This catches syntax errors without dropping traffic.
  2. Dump the fully resolved configuration with nginx -T to see what is actually in effect, including every include.
  3. Read the error log, not the access log, for 5xx causes. nginx names the failing upstream and the exact filesystem path it could not open.
  4. For permission errors, test as the server user: sudo -u www-data cat /path/to/file. Check execute bits on every parent directory.
  5. For binding failures, find the current listener with ss -tulpn | grep :80. Ports below 1024 need privileges or a capability such as CAP_NET_BIND_SERVICE.

Tools worth reaching for

  • nginx -t / nginx -T
  • apachectl configtest
  • ss -tulpn
  • tail -f error.log
  • sudo -u www-data

All 10 WebServer errors

Other categories