Static sites
A folder of files — an SPA, a docs site, a landing page — needs no process at
all. Point static: at the built directory and Caddy serves it directly
(automatic HTTPS, compression, ETags), so there’s nothing running on the box
but the file server.
app: docsdomain: docs.example.comstatic: ./dist # the built directorybuild: command: npm run build # optional — omit for plain HTML# spa: true # optional override; auto-detected by defaulthomeport deploy builds (if build.command is set), tars the directory,
streams it up, and flips an atomic symlink — the new files are live instantly,
zero downtime, no reload. Rollback is a flip.
SPA vs multi-page is auto-detected
Section titled “SPA vs multi-page is auto-detected”Client-routed apps get the right catch-all fallback; static-per-route sites don’t.
| Your build | Detected | Behaviour |
|---|---|---|
SvelteKit adapter-static (SPA) → 200.html |
SPA | unmatched routes serve the app shell |
Vite / CRA → lone index.html |
SPA | ″ |
Next output: export, Astro, Hugo, Docusaurus → per-route .html |
multi-page | clean URLs (/about → about.html); unmatched → 404 |
Set spa: true / false to override.