Skip to content
ohsudo, Home

Module 5: Real incidents

Incident: Nginx won't start

Someone edited the site's config and rebooted, and now the site is down. There are fewer instructions from here on: read what the system tells you.

● Runs 100% in your browser. Nothing here can harm a real system.

Step 1 of 6

Try the obvious

Start with the failure itself. The message may not say much, but it tells you where to look next.

Your task

Try to start nginx.

guest@ohsudo: ~ — Ubuntu 24.04

Starting the terminal…

What you'll practice

  1. Try the obvious. Start with the failure itself. The message may not say much, but it tells you where to look next.
  2. Read the log. The real error is in the service's log, usually right near the end.
  3. Test the config. nginx -t checks the configuration without changing anything. It names the file and the line, and you should run it before every reload.
  4. Fix it. The directive is called server_name, with an underscore, and someone typed servername. On Debian and Ubuntu, the file is in sites-enabled, a link to sites-available. The directive is called server_name, with an underscore, and someone typed servername. On RHEL, Rocky and AlmaLinux, sites go in /etc/nginx/conf.d.
  5. Start it. Test first, then start. && runs the second command only if the first one succeeds, so a bad config never gets started.
  6. Check it's really back. A running service doesn't prove the site works. Ask it, as a visitor would.

See also