Skip to content

Something broke: the web server won’t start

NinjaLesson 64 of 6612 min

A troubleshooting challenge: someone edited the web server’s config and now nginx won’t start. Find the error, fix the file and bring the site back.

Someone tidied up the web server's config last night. This morning http://web/ doesn't answer, and restarting nginx "didn't help". Find out why and get the site back, without guessing. The checklist only ticks when it really works.

A few things worth knowing before you start:

  • A service that fails to start writes why to the journal. systemctl status nginx shows the last lines; sudo journalctl -u nginx shows more.
  • sudo nginx -t checks the config files without touching the running server. Run it before every restart and you'll never take a working site down with a typo.
  • Config files under /etc belong to root, so edit them with sudo vim.
  • Programs report where they noticed a problem, which isn't always where you made it.

web is a pretend server inside this page. Reset puts everything back as it was.

Your turn

Get http://web/ answering again, with a config that nginx -t passes.

Next