This repository demonstrates the deployment of a Layer 4&7 load balancer using Docker and Nginx. The setup includes configuring Nginx to act as a load balancer for distributing HTTP traffic across multiple backend servers. Modern web applications often require robust infrastructure to handle varying levels of incoming traffic while maintaining high availability and performance. Implementing a load balancer is a common strategy to achieve these goals, distributing incoming requests across multiple backend servers.
- Scalability: Easily scale your web application by adding more backend server instances.
- Performance: Improve application performance by distributing incoming traffic across multiple servers.
- Reliability: Ensure high availability and redundancy with a resilient load balancing setup.
- Flexibility: Customize load balancing configurations to suit your specific application requirements.
- Docker installed on your machine.
- Basic understanding of Docker Compose for managing multi-container Docker applications.
To get started with this project, follow these steps:
-
Clone the Repository:
git clone https://github.com/TheToriqul/Layer-4-7-Load-Balancer-Deployment.git
-
Navigate to the Project Directory:
cd Layer-4-7-Load-Balancer-Deployment
-
Start the Application:
docker-compose up
-
Access the Application: Open your web browser and navigate to
http://localhost
.
- Defines services for Nginx server and backend servers.
- Specifies Nginx configuration and backend server Dockerfile locations.
- Sets up networking for communication between services.
- Configures Nginx as a Layer 7 (HTTP) load balancer.
- Defines upstream servers for backend server pool.
- Listens on port 80 and forwards HTTP requests to backend servers.
- Sets up a Node.js application image for backend servers.
- Installs dependencies and copies application code.
- Exposes port 3000 and specifies command to run the Node.js application.
Contributions to this project are welcome! Feel free to submit issues or pull requests with any improvements, bug fixes, or feature enhancements.
- Nginx: For providing a powerful and efficient web server and reverse proxy solution.
- Docker: For enabling containerization and simplifying the deployment process.
- Node.js: For providing a JavaScript runtime for building scalable and high-performance applications.
For any inquiries or support, feel free to contact [email protected].