Step 6 of 8 · lab · 25 min
Set up an nginx reverse proxy
The backend listens only on 127.0.0.1:3000 — publish it through nginx on port 80.
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
- The nginx configuration passes
nginx -t, and the nginx service is running. - nginx accepts requests on port 80 on every address of the machine.
- 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.
Lab · on your own
No commands are given in this lab: type them in the terminal yourself. Goals are checked on the machine after every command.
Goals
0 of 4-
The nginx configuration is valid — not done yet
-
The nginx service is active — not done yet
-
nginx listens on port 80 on every address of the machine — not done yet
-
Requests to http://localhost/ are answered by the inventory-api backend — not done yet
The machine is starting
Hints
0 of 3Lab goals
0 of 4-
The nginx configuration is valid — not done yet
-
The nginx service is active — not done yet
-
nginx listens on port 80 on every address of the machine — not done yet
-
Requests to http://localhost/ are answered by the inventory-api backend — not done yet
Goals are checked on the machine after every command.