# Caddy Modern Config

> Caddyfile configuration, auto-HTTPS, and FastCGI.

- Skill: `btafoya/caddy-modern-config` (Agent Skill)
- Install (CLI): `npx skillmds@latest add btafoya/caddy-modern-config`
- Raw SKILL.md: https://api.skillmd.com/api/skills/btafoya/caddy-modern-config/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: btafoya (https://skillmd.com/u/btafoya)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/btafoya/caddy-modern-config

---


# Caddy Modern Config

## When to use this skill
- Configuring Caddy as a web server or reverse proxy.
- Setting up local HTTPS.
- Deploying PHP/Python apps with Caddy.

## 1. Caddyfile Basics
- **Syntax**: `domain { directives }`.
- **Auto-HTTPS**: Enabled by default for any host that looks like a domain.

## 2. Reverse Proxy
- **Python/Node**:
  ```caddy
  example.com {
      reverse_proxy localhost:3000
  }
  ```

## 3. PHP (FastCGI)
- **Directives**: Use `php_fastcgi` preset.
  ```caddy
  example.com {
      root * /var/www/site/public
      php_fastcgi unix//run/php/php8.3-fpm.sock
      file_server
  }
  ```

## 4. Security
- **Headers**: Add basic security headers easily.
  ```caddy
  header {
      Strict-Transport-Security "max-age=31536000;"
      X-Content-Type-Options "nosniff"
  }
  ```

