# The proxy that cannot reach its healthy backend

A client reaches the reverse proxy but gets HTTP 502. The backend responds
directly on the same isolated network. Find the broken upstream connection
and restore traffic without changing the backend or publishing a host port.

## Before you begin

Use a disposable machine with Bash, Python 3, Docker and Docker Compose.
The lab creates the Compose project `breakfix-netops-03` and an internal
Docker network. It does not publish ports or create cloud resources. Docker
may download the nginx and Python images. Do not reuse the project name;
setup refuses pre-existing project resources and teardown checks ownership.

## Investigate

```sh
./setup.sh
docker compose -p breakfix-netops-03 ps
docker compose -p breakfix-netops-03 exec client python /lab/probe.py backend
docker compose -p breakfix-netops-03 exec client python /lab/probe.py proxy
docker compose -p breakfix-netops-03 logs proxy
docker compose -p breakfix-netops-03 exec backend nginx -T
```

Inspect `proxy.conf` and preserve the proxy and backend. After changing it,
recreate the proxy to pick up the edited bind-mounted file, including when
your editor replaces the file:

```sh
docker compose -p breakfix-netops-03 up -d --force-recreate proxy
docker compose -p breakfix-netops-03 exec proxy nginx -t
```

Run `./verify.sh` and `./teardown.sh` when finished. Teardown removes the
lab's containers and network but does not reset edited files; re-extract the
bundle to start again.

The [related Docker networking guide and demo](https://opsbreakfix.com/devops/understand-docker-volumes-and-container-networking/#see-it-run)
show network inspection and a direct container request. The demo does not
reproduce this reverse-proxy failure.
