Reverse Proxy 101: How Caddy Routes Traffic to Your Apps
Multiple apps, one server, one IP. Learn how a reverse proxy makes it all work with automatic HTTPS.
The Problem
You have one server with one IP address, but you want to run 10 different applications, each accessible at its own domain or subdomain. How does the server know which app to send each request to?
Enter the Reverse Proxy
A reverse proxy sits in front of your applications and routes incoming requests to the right backend based on the hostname.
When someone visits app-one.example.com, the reverse proxy looks at the Host header and forwards the request to the container running on port 3000. When someone visits app-two.example.com, it goes to port 8080 instead.
Why Caddy?
There are several reverse proxies — Nginx, Traefik, HAProxy — but Caddy stands out for self-hosting:
Automatic HTTPS
Caddy automatically obtains and renews SSL certificates from Let's Encrypt. No configuration needed. Just specify a domain and Caddy handles the rest.
Simple Configuration
A Caddy config to proxy a domain to a backend is two lines. Nginx requires 15-20 lines for the same thing.
HTTP/2 and HTTP/3 by Default
Caddy serves modern protocols out of the box, improving performance for all your applications.
On-Demand TLS
Caddy can provision certificates on-the-fly for new domains, perfect for platforms that generate subdomains dynamically.
How It Works in Practice
Here's what happens when a user visits your self-hosted app:
1. DNS resolves your-app.example.com to your server's IP
2. The request hits Caddy on port 443 (HTTPS)
3. Caddy terminates TLS (handles the encryption)
4. Caddy checks which backend matches the hostname
5. The request is forwarded to the correct container
6. The container processes the request and returns a response
7. Caddy sends the response back to the user
All of this happens in milliseconds.
TinyPod's Architecture
TinyPod uses Caddy as the reverse proxy on every VPS. When you deploy an app, we automatically configure Caddy to route your subdomain to the right container. When you add a custom domain, we add a new route and Caddy provisions the SSL certificate.
This is why you can run dozens of apps on a single TinyPod server — Caddy efficiently routes each request to the right place.