Skip to content

Exponential CMS

Caddy and FrankenPHP

Serve Exponential with Caddy and a PHP-FPM pool, or with FrankenPHP through Velocity or on its own.

Caddy

Caddy obtains and renews certificates by itself, redirects plain HTTP to HTTPS and speaks HTTP/2 and HTTP/3. The example doc/eng-us/examples/web-servers/Caddyfile.example serves Exponential with Caddy and a PHP-FPM pool. Its routing is the one Velocity generates for its FrankenPHP engine, with PHP handed to PHP-FPM, plus the first two rules of .htaccess_root.

  1. Install Caddy and create the PHP-FPM pool. Caddy's user must be able to open the pool's socket (listen.owner, listen.group).
  2. Copy the file to /etc/caddy/Caddyfile (or import it from there) and replace example.com, the e-mail address, /var/www/example.com and the socket.
  3. Make sure ports 80 and 443 reach the machine, for the certificate.
  4. Check and reload.
caddy validate --config /etc/caddy/Caddyfile
systemctl reload caddy

The example uses route, which keeps the directives in the written order, so the list reads like .htaccess_root. Dot paths and scripts below the root answer 404 first; @static is exactly Velocity's list of static paths; the rewrites send the REST API to index_rest.php, the tree menu to index_treemenu.php and everything else to index.php. Headers are set only when the page does not have them yet, so the kernel's own headers win.

FrankenPHP

FrankenPHP is Caddy with PHP built in, as one binary. There are two ways to run Exponential on it.

  • Through Velocity (recommended): exp:velocity downloads and verifies the binary, writes the Caddyfile from velocity.ini on every start, validates it and drives the server with the same commands as its other engines. Settings go in settings/override/velocity.ini.append.php, group [FrankenPHPSettings]. The generated file is var/vc/frankenphp/run/Caddyfile; do not edit it, because it is rewritten on every start, graceful and restart. Directives of your own go in the file named by SiteInclude.
  • On its own: copy doc/eng-us/examples/web-servers/frankenphp.Caddyfile.example to /etc/frankenphp/Caddyfile, replace the names and paths, and start frankenphp run. It adds automatic HTTPS, the security headers, the SVG sandbox and the first two rules of .htaccess_root.

Exponential uses FrankenPHP in classic mode: each request starts from a clean state, as under PHP-FPM. If a change to config.php does not show, restart the server (through Velocity: exp:velocity restart).

Note: Caddy and FrankenPHP never read .htaccess. Both examples were checked with frankenphp validate (FrankenPHP 1.12.7, Caddy 2.11).

Last updated 11/26/2026. Something missing or wrong? Write to info@se7enx.com.