alpine-nginx-lb is an alpine linux flavored docker container with nginx used to loadbalance applications with a minimal image with size less than 7MB.
build/sites.conf -> file is used to configure the uri paths of the applications to be load balanced.
docker-compose.yaml - is used to bring up application containers to be loadbalanced and also brings up the nginx container after all dependent containers are available.
docker-compose -f docker-compose.yml -p local-app-lb up -d
docker-compose -f docker-compose.yml -p local-app-lb down
npm start
npm stop
Server 1 Direct Server 2 Direct Server 3 Direct
Server 1 LB Server 2 LB Server 3 LB
127.0.0.1 qa1.test.com 127.0.0.1 qa1a.test.com 127.0.0.1 qa2.test.com 127.0.0.1 qa2.internal.test.com
Adding above hosts are to have those sample domains working on local machines. If you make any changes to the host names, also modify the same in conf.d file in build/loadbalancer/conf.d.
For real domains that can be resolved, shouldn't need these to be added to hosts file or to the conf.d file.
http://qa1.test.com:8000/ui/app/firstapp http://qa2.test.com:8000/ui/app/secondapp http://qa2.internal.com:8000/ui/app/thridapp
PORT 8000 is used for test purposes, so, we dont have any other port conflicts when running locally with port 80. try the above domain combinations with different paths will throw 404.