Modern Multi-Service Architecture with Apache, Docker & Terraform
Published: October 2026
Tags: DevOps, Terraform, Docker, Apache, Next.js
Monolithic single-server setups often get replaced by sprawling Kubernetes clusters that rack up huge cloud bills. But for many production systems, a well-architected Linux box orchestrated with Terraform, Docker Compose, and an Apache 2.4 reverse proxy delivers extreme performance, resilience, and simplicity.
Why Apache as a Modern Reverse Proxy?
While NGINX and Caddy get a lot of modern attention, Apache 2.4 remains one of the most mature, reliable reverse proxies available when properly configured:
mod_proxy&mod_proxy_http: High-concurrency socket pooling to containerized loopback services.- WebSocket Upgrade Routing: Seamless bidirectional support for Next.js Fast Refresh and WebSocket channels.
- Granular Path Routing: Routing
/to Next.js (port 3000),/v1/bioand/api/node/to Express (port 8080), and/primeor/weatherto Python Flask (port 9000) under a single TLS certificate.
Zero-Downtime Infrastructure as Code
By managing the entire machine in Terraform:
- Base packages, firewall rules, and systemd units are codified in
devops/terraform. - Static Hugo sites utilize atomic symlink directory swaps (
releases/<timestamp>->current). - Containerized microservices restart rolling containers on loopback ports without dropping client connections.
- Let's Encrypt certificates automatically renew through Certbot hooks.