cd devops-basics/topics/haproxy/basic/
docker-compose up --build -d
# To stop and remove contaienr, run:
docker compose down
cd devops-basics/topics/haproxy/basic/
docker-compose up --build
# To stop, press 'Ctrl + C'
Refresh the page multiple time and you would see that the HA Proxy route to nginx-webserver1
and nginx-webserver2
in Round Robin mode.
Now try to stop the nginx-webserver1
and refresh the page http://localhost:6081, it will check and only route to nginx-webserver2
docker stop nginx-webserver1