How Web Traffic Flows with User Containers
Caddy is the entry point for all incoming web traffic. When the first domain is added, Caddy automatically starts and begins listening on ports 80 (HTTP) and 443 (HTTPS).
Caddy is responsible for:
- SSL certificates & renewals
- Redirects (HTTP โ HTTPS)
- Web Application Firewall (CorazaWAF)
- Reverse proxying to user webservers
Per-User Webserversโ
Each user runs their own isolated webserver instance on a unique local port. Supported webservers include:
- Nginx
- Apache
- OpenResty
- OpenLiteSpeed
- Varnish
Caddy forwards requests to the correct userโs webserver, based on domain configuration.
Application Containersโ
The userโs webserver then proxies requests into application containers, such as:
- PHP-FPM (multiple versions supported)
- Node.js
- Python / Django / Flask
- Docker containers
Example flow for a PHP app:
Client โ Caddy โ Nginx โ PHP-FPM container
Example flow for a Node.js app:
Client โ Caddy โ Nginx โ Node.js container
Handling Multiple PHP Versionsโ
Each user runs its own PHP-FPM container version, ensuring compatibility with different frameworks or legacy apps. Multiple PHP versions (7.4, 8.0, 8.1, 8.2, 8.3, etc.) can coexist safely for a userL
Example:
Site A
Client โ Caddy โ Nginx โ PHP-FPM-8.2
Site B
Client โ Caddy โ Nginx โ PHP-FPM-7.4
Site C
Client โ Caddy โ Nginx โ PHP-FPM-8.3
Using Varnish (Optional)โ
If a user enables Varnish caching, it sits between Caddy and the webserver:
Client โ Caddy โ Varnish โ Webserver โ php container
This allows caching and performance acceleration before hitting the backend.
Example Flowsโ
PHP (Nginx + PHP-FPM-8.2)โ
Client โ Caddy (SSL, WAF, redirects)
โ Nginx (per-user webserver)
โ PHP-FPM-8.2 (specific PHP version)
PHP (with Varnish + PHP-FPM-8.1)โ
Client โ Caddy (SSL, WAF, redirects)
โ Varnish (caching)
โ Nginx (per-user webserver)
โ PHP-FPM-8.1 (specific PHP version)
Node.jsโ
Client โ Caddy (SSL, WAF, redirects)
โ Nginx (per-user webserver)
โ Node.js (userโs container)
OpenLiteSpeed (with built-in LSPHP)โ
Client โ Caddy (SSL, WAF, redirects)
โ OpenLiteSpeed (VHost + lsphp runtime)
โ In short: Caddy is always the first entry point โ routes traffic to a userโs webserver โ which proxies requests to the userโs application container (PHP version, Node.js, etc.).