Situation
nginx on this server hosts two company sites: the main site www.lab.test and the engineering blog
blog.lab.test. The blog recently moved to a name of its own. The main site's files live in /srv/www/main,
the blog's in /srv/www/blog: the home page index.html and the archive archive.html. A request with a name
that no site has gets 404.
The main site opens as usual. But http://blog.lab.test/ returns the main site's home page instead of the
blog.
Both names are in /etc/hosts and point to this same machine, so you can run curl http://blog.lab.test/
right here.
Task
blog.lab.testserves files from/srv/www/blog: the home page and/archive.html.www.lab.testserves files from/srv/www/main, as before.- A request with an unknown site name gets 404.
- nginx is running, and its configuration passes
nginx -twithout warnings.
There is no internet on the machine; everything you need is already installed. Run administrative commands with
sudo.
Lab goals
0 of 4-
blog.lab.test serves files from /srv/www/blog — the home page and /archive.html — not checked yet
-
www.lab.test serves files from /srv/www/main, as before — not checked yet
-
A request with an unknown site name gets 404 — not checked yet
-
nginx is running and its configuration passes nginx -t without warnings — not checked yet
Hints
0 of 3 open · they open one at a time
Hint 1
Show the solution
after 3 failed checks