nixopus/nixopus/caddyfile-generation
Claude Code and agent skill by nixopus/nixopus
- community
Checking that the SKILL.md file is still in the repository.
Generate Caddyfile configurations for static sites and reverse proxies — SPA fallback routing, cache headers, compression, redirects, and error pages. Use when deploying a static site that needs custom Caddy configuration, or when the user needs SPA routing, caching, or redirect rules.
Install
npx vskill@latest install nixopus/nixopus/caddyfile-generationSKILL.md
The same SKILL.md was published earlier as nixopus/nixopus/caddyfile-generation.
Caddyfile Generation
When to Generate
- Static sites served by Caddy (from
static-deployor frontend builds) - SPA applications that need fallback routing (React, Vue, Angular, SvelteKit static)
- Sites needing custom cache headers, compression, or redirects
Base Template
Minimal Caddyfile for a static site:
SPA Fallback Routing
Single-page apps need all non-file routes to return index.html:
Frameworks that need this: React (CRA, Vite), Vue, Angular, SvelteKit (static adapter), Remix (SPA mode).
Frameworks that do NOT need this: Next.js (has its own server), Nuxt (SSR), Astro (generates individual HTML files for each route).
Cache Headers for Hashed Assets
Frontend build tools (Vite, Webpack) produce files with content hashes (e.g. main.a1b2c3.js). These can be cached aggressively:
HTML files must NOT be cached (they reference the hashed assets).
Compression
Enable gzip and zstd compression:
Redirects
www to non-www
HTTP to HTTPS
Caddy handles this automatically when using domain names. Only needed for explicit port-based configs:
Note: In Nixopus deployments, the proxy layer already handles TLS termination. Do NOT add HTTPS redirects in the app's Caddyfile — the proxy handles this.
Custom Error Pages
Reverse Proxy (API backend)
When a static frontend needs to proxy API requests to a backend:
Security Headers
Complete Production Template
Combines SPA routing, caching, compression, and security headers:
Generation Logic
- Determine if the app is a SPA (needs
try_filesfallback) or multi-page (doesn't) - Start with the base template
- Add
try_files {path} /index.htmlif SPA - Add
encode zstd gzipfor compression - Add hashed asset cache headers if the build tool produces hashed filenames
- Add security headers
- Write to
Caddyfileat the project root
Gotchas
- Caddy listens on
:80inside Docker — the proxy layer handles external port mapping and TLS try_filesmust come BEFOREfile_serverin the Caddyfileroot * /srvmust match the COPY destination in the Dockerfile- Do NOT configure HTTPS/TLS in the Caddyfile for Nixopus deployments — the edge proxy handles TLS termination
- Caddy's
file_serverserves directory listings by default — addfile_server browseonly if intentional
Related Skills
- `static-deploy` — Dockerfile patterns that use Caddy as the web server
- `dockerfile-generation` — Generate the Caddyfile alongside the Dockerfile
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingapi/skills/caddyfile-generation/SKILL.md
Popularity
- Repository stars
- 1,456
- Repository forks
- 133
- 7-day trend score
- 36
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 4 Aug 2026, 3 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/nixopus/nixopus/caddyfile-generation)