🎯 Mission Briefing: One Missing Character
Marko added the new web shop to nginx, restarted the server and left for a two-week holiday. Since then every site on this server is down. Nobody else knows nginx — so it's on you.
Your objective
Find out why nginx won't start, locate the exact broken line, fix it, and bring the web server back.
Investigation toolkit
cat ~/handover.txt # What did Marko change?
systemctl status nginx # Is nginx running? Since when not?
journalctl -u nginx -n 20 # The error from the failed start
sudo nginx -t # Test the configuration: which file, which line?
cat -n /etc/nginx/conf.d/shop.conf # Look at the file with line numbers
Fix and verify
sudo nano /etc/nginx/conf.d/shop.conf # Fix the line nginx -t points at
sudo nginx -t # Test again until it says "syntax is ok"
sudo systemctl restart nginx
curl -I http://localhost
💡 Always run
sudo nginx -tbefore restarting nginx. A restart with a broken config takes down every site on the server;nginx -tcosts nothing.
💡 An error on line N is often caused by the line before it — nginx reads until it finds the
;that ends a directive.