๐ DevOps Reverse Proxy Project

Nginx + Docker Compose + Go + Flask Microservices
๐ฆ Project Overview
This project sets up a Docker Compose-based environment with:
๐จ Service 1 (Go) โ Returns JSON from
/ping
and/hello
๐ฆ Service 2 (Python Flask) โ Returns JSON from
/ping
and/hello
๐งญ Nginx Reverse Proxy โ Routes traffic to both services on a single port
๐ผ๏ธ Screenshot
โ๏ธ Setup Instructions
Install Docker and Docker Compose
Clone this repository:
git clone https://github.com/your-username/devops-nginx-proxy.git cd devops-nginx-proxy
Run the entire system with:
docker compose up --build
Once running, visit the endpoints in your browser or use curl
:
๐ How Routing Works
Nginx is configured to proxy requests based on URL path:
/service1/*
โก๏ธ routed to Go app onhttp://service1:8001
/service2/*
โก๏ธ routed to Flask app onhttp://service2:8002
location /service1/ {
proxy_pass http://service1:8001/;
rewrite ^/service1(/.*)$ $1 break;
}
location /service2/ {
proxy_pass http://service2:8002/;
rewrite ^/service2(/.*)$ $1 break;
}
โจ Bonus Features Implemented
โ Docker Health Checks for both services
โ Nginx Access Logs with timestamp and URL
โ Bridge Networking for container isolation
โ Single-Port Access through
localhost:8080
๐งช (Optional) Test-ready via CURL or browser
๐ Folder Structure
.
โโโ docker-compose.yml
โโโ nginx/
โ โโโ nginx.conf
โ โโโ Dockerfile
โโโ service_1/
โ โโโ main.go
โ โโโ Dockerfile
โโโ service_2/
โ โโโ app.py
โ โโโ requirements.txt
โ โโโ Dockerfile
โโโ README.md
๐ง Author & Notes
Developed as part of a DevOps internship assignment.
Built using Linux-friendly, reproducible Docker containers.
Note: Do not use Flask's built-in server for production.
Subscribe to my newsletter
Read articles from Kamlesh Parihar directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by

Kamlesh Parihar
Kamlesh Parihar
๐ Cloud | DevOps | Scripting Enthusiast Hi, Iโm Kamlesh Parihar โ a passionate DevOps learner and tech blogger who thrives on solving problems with automation, cloud-native tools, and clean code. I write about AWS, CI/CD, Docker, Kubernetes, Python scripting, and anything that simplifies development and operations. ๐ง Sharing insights, tutorials, and real-world project experiences to help others grow in their DevOps journey. ๐ Lifelong learner. Open-source supporter. Tech community advocate. โ๏ธ Follow along as I break down complex DevOps concepts into simple, actionable posts.