Generate production Apache 2.4 VirtualHost configuration files (*.conf and *-le-ssl.conf) with path-based reverse proxy routes and disk caching, using a2ensite and Let's Encrypt.
The root handler above covers /. Add extra paths here — e.g. forwarding a single bot or webhook path to a backend while the rest of the site stays static.
{{ trailingSlashWarning }}
Each route becomes a ProxyPass / ProxyPassReverse pair. Per Apache's own docs, if the path ends with / the target must too (and vice versa), or requests to the backend can lose a slash.
Targets Apache 2.4. Requires a2enmod cache cache_disk expires headers. On Debian/Ubuntu, enabling cache_disk also sets a default CacheRoot /var/cache/apache2/mod_cache_disk — Apache refuses to start with mod_cache_disk loaded and no CacheRoot at all, but the package supplies one automatically.
Requires a2enmod headers (same module the cache block's Header merge needs).
Requires a2enmod deflate.
Apache uses <VirtualHost *:80> and <VirtualHost *:443> directives to manage HTTP and HTTPS traffic per domain, mapping domain names to document roots or backend proxy targets. Everything on this page targets Apache 2.4 and the Debian/Ubuntu a2enmod/a2ensite tooling.
Path-based routes use ProxyPass/ProxyPassReverse exactly as documented for mod_proxy, and the cache block follows mod_cache and mod_cache_disk's own directive syntax — see the inline "i" hints for specifics and module requirements.