Production-style AWS infrastructure using EC2, Nginx, Apache2, HTTPS, EBS, Security Groups, and CloudWatch monitoring.
This project demonstrates the deployment of a secure and highly available web infrastructure on AWS using multiple Ubuntu EC2 instances.
The architecture uses:
- Nginx as the public-facing reverse proxy and load balancer
- Two Apache2 servers as private backend servers
- AWS Security Groups to control network communication
- HTTPS for encrypted client-to-server communication
- Amazon EBS for persistent storage
- Amazon CloudWatch for basic infrastructure monitoring
The main goal was to understand how multiple infrastructure components work together to create a secure, scalable, and fault-tolerant web environment.
π INTERNET
β
HTTP / HTTPS
β
βΌ
βββββββββββββββββββββββββββ
β EC2-1 β
β Ubuntu + Nginx β
β β
β Reverse Proxy β
β Load Balancer β
β HTTPS / SSL β
ββββββββββββββ¬βββββββββββββ
β
Private AWS Network
β
βββββββββββββ΄ββββββββββββ
β β
βΌ βΌ
ββββββββββββββββββββ ββββββββββββββββββββ
β EC2-2 β β EC2-3 β
β Ubuntu + Apache2 β β Ubuntu + Apache2 β
β β β β
β Backend #1 β β Backend #2 β
ββββββββββββββββββββ ββββββββββββββββββββ
β
βΌ
βββββββββββββββββββ
β EC2-1 EBS β
β 8 GiB gp3 β
β /data β
βββββββββββββββββββ
| Feature | Implementation |
|---|---|
| βοΈ Cloud Infrastructure | 3 Ubuntu EC2 instances |
| π Reverse Proxy | Nginx |
| βοΈ Load Balancing | Nginx Round-Robin |
| π₯οΈ Backend Servers | 2 Γ Apache2 |
| π Secure Communication | HTTPS / SSL |
| π‘οΈ Network Security | AWS Security Groups |
| πΎ Persistent Storage | 8 GiB gp3 EBS |
| π Monitoring | CloudWatch + Linux utilities |
| π Failure Testing | Backend failure simulation |
| π Documentation | Git & GitHub |
The application follows this request flow:
Client
β
β HTTP / HTTPS
βΌ
Nginx
β
ββββββββββββββββΊ Apache Backend 1
β
ββββββββββββββββΊ Apache Backend 2
β
βΌ
Web Application
Nginx distributes incoming requests between the two Apache2 backend servers using round-robin load balancing.
This allows the application to continue serving traffic even if one backend server becomes unavailable.
Three Ubuntu EC2 instances were deployed:
| Instance | Role | Network |
|---|---|---|
| EC2-1 | Nginx Reverse Proxy / Load Balancer | Public |
| EC2-2 | Apache2 Backend Server 1 | Private |
| EC2-3 | Apache2 Backend Server 2 | Private |
Apache2 was installed and configured on both backend instances.
Both servers host the same custom web application.
The backend servers communicate with Nginx using their private IP addresses.
This prevents direct public access to the backend web servers.
Nginx acts as the entry point for incoming web traffic.
An upstream group was configured containing both Apache2 backend servers:
upstream apache_servers {
server <BACKEND-1-PRIVATE-IP>;
server <BACKEND-2-PRIVATE-IP>;
}Nginx then forwards requests to the backend servers:
location / {
proxy_pass http://apache_servers;
}The project uses round-robin load balancing.
Request 1 βββΊ Backend 1
Request 2 βββΊ Backend 2
Request 3 βββΊ Backend 1
Request 4 βββΊ Backend 2
This distributes incoming traffic across both backend servers.
HTTPS was configured on the public Nginx server using a self-signed SSL certificate.
Client
β
β HTTPS
βΌ
Nginx
β
β HTTP
βΌ
Private Apache Backends
β οΈ Since this project uses a self-signed certificate without a registered domain, browsers may display a certificate warning. This is expected for the project environment.
Security Groups were configured to restrict communication between the infrastructure components.
Allows:
HTTP β Internet
HTTPS β Internet
SSH β Administrator IP
Allow:
HTTP β Nginx Security Group
SSH β Restricted Administration
The backend servers are therefore not directly exposed to the public internet.
INTERNET
β
βΌ
βββββββββββββββ
β NGINX β
β Public EC2 β
ββββββββ¬βββββββ
β
Private Network
β
βββββββββ΄ββββββββ
βΌ βΌ
Apache #1 Apache #2
Private Private
An 8 GiB gp3 EBS volume was attached to the Nginx EC2 instance.
The volume was mounted at:
/dataThe mount configuration was added to:
/etc/fstab
The volume UUID was used to ensure that the storage remains automatically mounted after a server reboot.
df -hlsblkBasic infrastructure monitoring was performed using Amazon CloudWatch and Linux system utilities.
df -hfree -hsystemctl status nginxsystemctl status apache2CloudWatch was used to monitor infrastructure-level metrics such as CPU utilization.
To verify the resilience of the load-balanced architecture, one Apache backend server was intentionally stopped.
Before Failure
Nginx
ββββΊ Apache #1 β
ββββΊ Apache #2 β
After Stopping Apache #1
Nginx
ββββΊ Apache #1 β
ββββΊ Apache #2 β
Traffic continued through the remaining backend server.
This demonstrated the practical benefit of having multiple backend servers behind the Nginx load balancer.
The infrastructure was verified through multiple tests.
- 3 Ubuntu EC2 instances successfully configured
- Nginx deployed on the public-facing instance
- Apache2 deployed on both backend instances
- Nginx service verified as active
- Both Apache2 servers successfully served the application
- Backend communication verified through private IP addresses
- HTTP
200 OKresponses confirmed
- HTTPS endpoint successfully configured
- HTTPS requests returned successful responses
- Self-signed certificate warning expected in browsers
- 8 GiB gp3 EBS volume attached
- Volume mounted at
/data - Persistent mount configured using
/etc/fstab - Persistence verified after reboot
- Round-robin distribution configured
- Backend failure scenario tested
- Remaining backend continued serving requests
A custom DevOps Cloud web application was deployed on both Apache2 backend servers.
Users access the application through the public Nginx endpoint.
User
β
βΌ
HTTPS
β
βΌ
Nginx
β
ββββββββΊ Apache #1
β
ββββββββΊ Apache #2
β
βΌ
DevOps Cloud Website
This project provided hands-on experience with:
- βοΈ AWS EC2 infrastructure
- π§ Ubuntu server administration
- π Nginx reverse proxy configuration
- βοΈ Load balancing
- π₯οΈ Apache2 web server deployment
- π HTTPS / SSL configuration
- π‘οΈ AWS Security Groups
- πΎ EBS persistent storage
- π CloudWatch monitoring
- π Failure testing
- π Private networking
- π§ Linux service management
- π Git & GitHub
This project demonstrates how a multi-server web architecture can be designed and deployed using AWS infrastructure.
The implementation combines:
EC2
β
βββ Nginx
β βββ Reverse Proxy
β βββ Load Balancer
β βββ HTTPS
β
βββ Apache2 Backend #1
β
βββ Apache2 Backend #2
β
βββ Security Groups
β
βββ EBS
β
βββ CloudWatch
It provided a strong practical foundation for understanding AWS infrastructure, web server administration, networking, security, load balancing, and DevOps fundamentals.
The architecture can be further enhanced with:
- π Let's Encrypt SSL certificates
- π Custom domain name
- βοΈ AWS Application Load Balancer
- π Auto Scaling
- π Advanced CloudWatch dashboards
- π¨ CloudWatch alarms & SNS notifications
- ποΈ Infrastructure as Code using Terraform
- π CI/CD pipeline
- π³ Containerization
- π€ Automated deployments
Sparsh Jambhulkar
π B.Tech β Robotics & Artificial Intelligence
Interests:
AWS β’ Cloud β’ DevOps β’ Linux β’ Infrastructure
β If you found this project useful, consider giving the repository a star!
Built as part of my hands-on journey into AWS & DevOps.