Skip to content

moukhtiar/azure-load-balance

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Azure Load Balancer with NGINX (Terraform)

Built with Azure Load Balancer Terraform NGINX

Status

Production-grade high availability architecture using Azure Load Balancer with private backend VMs, health probes, and Terraform (IaC).

This project demonstrates a highly available web application architecture deployed on Microsoft Azure using Terraform.

Architecture Diagram

Architecture Diagram

🔄 Traffic Flow

  1. Client sends request to Load Balancer Public IP
  2. Load Balancer checks backend health via HTTP probe
  3. Traffic is distributed across healthy VMs
  4. NGINX serves the response

Architecture Overview

  • Azure Virtual Network (VNet)
  • Subnet (10.0.1.0/24) hosting backend VMs
  • 2x Ubuntu Virtual Machines (Private IP only)
  • Azure Public Load Balancer (Layer 4)
  • Backend Pool (VMs)
  • Health Probe (HTTP:80)
  • Load Balancing Rule (80 → 80)
  • Backend VMs use private IPs only (no direct internet exposure)

Load Balancer Traffic Distribution (Proof)

Result


Deployment

cd terraform
terraform init
terraform apply

Testing

curl http://<LOAD-BALANCER-PUBLIC-IP>

Loop test:

for i in {1..10}; do curl http://<LOAD-BALANCER-PUBLIC-IP>; echo; done

📁 Project Structure

terraform/   → Infrastructure as Code
images/      → Diagram & results
docs/        → Detailed architecture explanation

Key Concepts

  • Azure Load Balancer (Layer 4)
  • Backend Pool & Health Probes
  • Terraform Infrastructure as Code
  • Custom Script Extension

Future Improvements

  • Replace VMs with VM Scale Set (VMSS)
  • Add Azure Application Gateway (Layer 7)
  • Enable HTTPS (SSL)
  • Integrate Azure Monitor & Logging

👨‍💻 Author

Muktar Mohamed Azure Cloud Engineer

About

Azure Load Balancer + NGINX (Terraform) project demonstrating high availability with private backend VMs, health probes, and traffic distribution.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages