The server runs two company sites: the portal portal.lab.test and the docs docs.lab.test. nginx serves both. Users report that the docs address opens the portal.
Request both sites by name and see where these names lead. “Start” will set up the sites.
Request both sites by name
Request the portal and the docs by their names, then see which address these names lead to.
First, predict
What will curl http://docs.lab.test/ print?
Now start the exercise, run the command and compare your prediction with the output.
Both names lead to 127.0.0.1. What does that mean for the two requests?
-
Both sites live on this machine, and 127.0.0.1 is the right address for docs: nginx answers there. The name is not the problem.
-
curl keeps nothing between runs: each run is a new connection, and
curl -vshows it in the lines starting with*.
Both names lead to 127.0.0.1, so both requests reached one nginx on port 80, and it chose the page for each.