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