Example showing how to do path based routing using nginx as reverse proxy
- Using 3 nginx containers as targets, each loading some static content
- http only, no ssl
- path / routes to default-target container
- path /2 routes to target2 container
- path /3 routes to target3 container
Git and Docker installed and working
-
Clone repo
-
Bring stack up
docker-compose up - d
-
Test endpoints / targets
curl localhost curl localhost/2 curl localhost/3
-
Check individual container logs
docker-compose logs default-target docker-compose logs target2 docker-compose logs target3 docker-compose logs proxy
-
shutdown
docker-compose down