Linux Labs

Web stack / Stage 2 of 9 · step 6 of 8

Set up an nginx reverse proxy

medium ~25 min
Not running Starting usually ~20 s
Report a problem

Situation

The inventory-api backend runs on the server. It listens only on 127.0.0.1:3000, so other machines cannot reach it. You have been asked to publish it through nginx, which is already installed on the server: requests on port 80 should go to the backend, and its response should go back to the client.

Task

  1. The nginx configuration passes nginx -t, and the nginx service is running.
  2. nginx accepts requests on port 80 on every address of the machine.
  3. nginx passes any request to http://localhost/ to the backend and returns its response.

There is no internet on the machine; everything you need is already installed. Run administrative commands with sudo.

Visible only to you. Saved as you type.

All notes

Lab goals

0 of 4
  • The nginx configuration is valid — not checked yet
  • The nginx service is active — not checked yet
  • nginx listens on port 80 on every address of the machine — not checked yet
  • Requests to http://localhost/ are answered by the inventory-api backend — 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…