Linux Labs

Packages, services, and logs / Stage 7 of 13 · step 7 of 8

Fix nginx

easy ~15 min
Not running Starting usually ~20 s
Report a problem

Situation

The server ran a website on nginx. After yesterday's work on the server the site stopped opening: curl http://localhost/ says Couldn't connect to server. Nobody remembers what exactly was changed.

Task

  1. The default site answers at http://localhost/ with status 200 again.
  2. nginx runs as a systemd service, and its configuration passes the nginx -t check.
  3. The default site — the file /etc/nginx/sites-enabled/default and its listen lines — stays in place: fix the error rather than work around it.

The tools you need (nginx, curl) are already installed. There is no internet on this machine.

Visible only to you. Saved as you type.

All notes

Lab goals

0 of 4
  • The nginx configuration passes nginx -t — not checked yet
  • The nginx service is active — not checked yet
  • http://localhost/ returns HTTP 200 — not checked yet
  • The default site is still in place — not checked yet

Hints

0 of 3 open · they open one at a time
Hint 1
Show the solution after 3 failed checks

Leave the lab?

The machine keeps running for 10 more minutes, then it is removed. Files are lost; completed goals stay.

Loading…