This example shows how to use multiple configuration files for HAProxy.
The code is to complement my Medium article Split HAProxy config into multiple files.
Prerequisites: Docker and Docker Compose installed.
git clone https://github.com/NullIsNot0/haproxy-multiple-configfiles.git
cd haproxy-multiple-configfiles
# If you have Docker Compose version 1.x, run this:
docker-compose up
# If you have Docker Compose version 2.x, run this:
docker compose up
Open http://localhost:3000 for site01.
Open http://localhost:3001 for site02.
Open http://localhost:4001 for HAProxy stats page.