A simple project to implementing Load Balancing using Nginx + Node JS + Docker.
Make sure you already install the docker & docker-compose, and clone the repository.
# 1. build the images.
docker-compose build
# 2. create & start the containers, and run it in the backround
docker-compose up -d
# 3. make sure the containers is ready.
docker container ls --filter="name=my-*"
Round Robin Load Balancing : http://127.0.0.1
Cache Request : http://127.0.0.1/cache
The service is running for 6 ports (3300 - 3305), which whole of the services is connect to the proxy, and the api only can be accessed throught the proxy servers with the specific custom header that already define in the container of API Service.
Check the results :