Linux Labs

Web stack / Stage 2 of 9

Reverse proxy and 502

Not running Starting usually ~20 s
Leave the lesson

Step 3 of 8 · on a machine · 5 min

Test the second leg yourself

The cause is found; what is left is to remove it and test both legs.

You can walk the second leg without nginx: send a request from the server itself to the address the application listens on. If the application answers, it is alive, and the address in proxy_pass is what needs fixing.

bash
curl -i http://127.0.0.1:8001/

The Server header says BaseHTTP and a Python version: the application itself answered. The line shop: GET / is its answer: the application writes the path it received.

After the change the order is the same as for any site: sudo nginx -t, sudo systemctl reload nginx, a request by name. Through nginx the application should answer with the same line as directly.

Exercise · do it

Fix the shop

Make http://shop.lab.test/ answer with the shop application's page. The site is described in /etc/nginx/sites-available/shop; leave the application and its address alone.

Sign in and start The machine is available after signing in

Goals · 0 of 2

  • Get the site's requests through to the application not done yet
  • Leave the application as it is not done yet

Step goals

0 of 2
  • Get the site's requests through to the application — not done yet
  • Leave the application as it is — not done yet
Ubuntu 24.04

Step goals

0 of 2
  • Get the site's requests through to the application — not done yet
  • Leave the application as it is — not done yet
Loading…