Skip to content
Back to skills

Caddy Knowledge Patch

ASecurity

Caddy

  • 25 stars
  • 0 votes
  • 0 copies
  • 11 views
  • Added May 27, 2026
developmentrustgophpexpressapibackend

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 6 files and shows the line behind each finding

Scanned December 1, 2026

npx -y skills add Nevaberry/nevaberry-plugins --skill caddy-knowledge-patch --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Caddy Knowledge Patch?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Caddy Knowledge Patch
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/nevaberry-caddy-knowledge-patch/badge)](https://www.skillsdirectory.com/skills/nevaberry-caddy-knowledge-patch)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: caddy-knowledge-patch
description: Caddy
version: "2.11.9"
license: MIT
metadata:
  author: Nevaberry
---


# Caddy compatibility guidance

Load this skill when configuring, upgrading, operating, or extending Caddy.
It covers Caddyfile and JSON configuration, certificate automation, TLS,
HTTP routing, reverse proxying, server operations, logs, metrics, and extensions.
Use the topic references for complete guidance and behavior-specific attribution.

## Reference index

| Reference | Topics |
| --- | --- |
| [Automatic HTTPS and ECH](references/automatic-https-and-ech.md) | Certificate names, wildcard selection, redirects, DNS providers, ACME challenges, ECH publication and rotation |
| [HTTP and Caddyfile](references/http-and-caddyfile.md) | Snippets, routing, matchers, placeholders, headers, request bodies, static files, compression, authentication, validation |
| [Observability and extensions](references/observability-and-extensions.md) | Logging, rotation, metrics, tracing, CLI, Go builds, module APIs, event hooks |
| [Reverse proxy](references/reverse-proxy.md) | Identity headers, forward authentication, health checks, retries, TLS transports, streaming, WebSockets, FastCGI |
| [Server operations](references/server-operations.md) | Timeouts, request limits, sockets, trusted proxies, keepalive, reloads, shutdown, admin access |
| [TLS and PKI](references/tls-and-pki.md) | Automation controls, handshake policies, client authentication, trust pools, certificate managers, local CAs, storage |

## Upgrade checks

### Removed and deprecated settings

Remove deprecated `rate_limit` and `burst` settings from TLS automation configuration.
In 2.10.0, managed wildcard certificates cover matching configured subdomains by
default: remove `auto_https prefer_wildcard`. To obtain an individual certificate
for a covered site, set `force_automate` in its `tls` block.

Use `roll_compression` in place of deprecated `roll_gzip`; file log outputs
can compress rotated logs with Zstandard.

### Proxy identity and authorization headers

For HTTPS upstreams, `reverse_proxy` sets `Host` to `{upstream_hostport}` by default.
If the backend routes on the original incoming host and port, preserve them explicitly:

```caddyfile
reverse_proxy https://backend.example.net {
    header_up Host {http.request.hostport}
}
```

The reverse proxy identifies itself through `Via`; update checks that relied on its
extra `Server` header. In 2.11.2, `forward_auth` clears client-supplied values for
the destination headers in `copy_headers`. If the authorization response omits a
source header, the corresponding destination header is absent downstream.

### Timeouts and request acceptance

Request-header reads default to one minute; `read_header` in the server's `timeouts`
block changes that deadline. In 2.11.6, `read_body_idle` and `write_idle` default to
one minute without progress and support optional minimum transfer rates.

Upgrade from 2.11.6 to 2.11.7 for fixes to HTTP/2 proxy crashes and HTTP/1.1 streams
cut short after a request body, and to let HTTP/2 streams pause between writes
without hitting `write_idle`.

In 2.11.8, a route's `timeouts` overrides server-wide idle timeouts; the innermost
route wins. A negative idle timeout disables that timer. Handler-set deadlines cap
the effective timeout, and the HTTP/2 read timer runs only during a body read.

In 2.11.6, request headers default to a 16 KiB limit; oversized headers receive 431.
Use `max_header_size 32KB` inside the applicable `servers` block to raise it.
Incoming header fields with dots or underscores are dropped; keep specific legacy
fields with `expected_dot_headers` or `expected_underscore_headers` under `servers`.

Caddy rejects invalid or dots-only request hostnames with HTTP 400 before routing.
`request_body` with `max_size` immediately returns 413 when the declared
`Content-Length` exceeds the limit, even if nothing reads the request body.

### Client authentication and TLS policy changes

A site with its own hostname block no longer inherits `client_auth` from a covering
wildcard site. Configure it explicitly on each specific site requiring mutual TLS.
With a configured verifier, `client_auth request` and `verify_if_given` allow clients
that present no certificate. In 2.11.9, adaptation rejects conflicting `client_auth`
settings in site blocks whose TLS connection policies merge for the same hostname.

TLS client authentication automatically enables `strict_sni_host`, returning 421
when the request Host differs from the TLS server name. Missing or malformed
configured client CA certificate files cause provisioning to fail.

### FastCGI, file candidates, and compression

The default `php_fastcgi` fallback sends missing paths to PHP as `index.php` even
when that file is absent. If the site relies on the file server's 404 for such paths,
review its FastCGI try policy. In 2.11.9, a `try_files` or `file` candidate must end
in `/` to match a directory; in 2.11.8, candidates ending in `/` can only match directories.

In 2.11.9, FastCGI returns 400 if escaped and decoded paths select different scripts,
or a Windows script path uses an 8.3 alias or an NTFS alternate data stream.
Explicit FastCGI `env` settings take precedence over `HTTP_*` values from headers.

`encode` honors response `Cache-Control: no-transform` independently of that directive
on requests. Responses eligible for encoding receive `Vary: Accept-Encoding` even
when uncompressed. To keep excluding requests that carry the directive, use a matcher:

```caddyfile
@transformable not header Cache-Control *no-transform*
encode @transformable
```

### Configuration validation and order

Adaptation rejects blocks on `log_skip`; use a matcher argument such as `log_skip /healthz`.
Configuration validation rejects duplicate named routes and JSON `@id` values,
repeated `uri` settings in `forward_auth`, invalid `weighted_round_robin` weights,
and non-integer `browse file_limit` values.

Combine multiple `expression` lines in one matcher set with `&&`. `handle_errors`
blocks with status codes and `vars` directives with non-path matchers follow
Caddyfile order; check overlapping status codes and repeated variable assignments.

## Configuration quick reference

### Shared DNS provider and ECH

The global `dns` option, or JSON `apps.tls.dns`, configures a provider shared by
ACME DNS challenges and ECH publication. With a global provider, `acme_dns` without
arguments selects it for ACME; an explicit `acme_dns` provider takes precedence.
The global `tls_resolvers` option supplies ACME DNS resolvers across sites.

```caddyfile
{
    dns cloudflare {env.CLOUDFLARE_API_KEY}
    ech ech.example.net
}

example.com {
    respond "OK"
}
```

Set the ECH public name to a name that resolves to the server; Caddy obtains a certificate for it.
Automatic DNS publication requires an existing DNS record for each site and skips
CNAME aliases. Use a nonempty public name: an empty name can produce a configuration
clients reject. With ECH configured, key rotation is automatic.

For names independent of HTTP site routing, set `tls_automate_names cert.example.com`
in the global options block. Configuration changes cancel in-flight certificate work;
batch frequent changes into fewer reloads to give background issuance time to finish.

### Snippets, request matching, and bodies

An `import` can pass a directive block to a snippet, which expands it at `{block}`.
Nested directives are preserved, and an omitted block expands to nothing.
`{?query}` includes a leading `?` only for a nonempty query; for example,
`redir /old /new{?query} 308` carries the query without adding an empty delimiter.

The `url_pattern` matcher accepts named groups, wildcards, and regexp components.
Named captures use `{http.url_pattern.<component>.<group>}`; CEL expressions can use
the `url_pattern` function.

```caddyfile
example.com {
    @product url_pattern https://example.com/products/:id
    respond @product "{http.url_pattern.pathname.id}"
}
```

Use `set` inside `request_body` to replace the body for downstream handlers;
the handler updates the content length. Reading an oversized body through a
placeholder returns 413. Missing `{http.request.cookie.*}` values and
`{http.request.tls.*}` on plain HTTP resolve to empty strings in 2.11.7, including
places that preserve unknown placeholders.

### Proxy health, retries, and streams

`health_upstream` sends active checks to a separate endpoint while preserving the
original backend address in `{http.reverse_proxy.active.target_upstream}`.
Probes can specify `health_method` and `health_body`. Health state is tracked per
distinct check configuration, so handlers sharing an upstream can use different probes.

`lb_retry_match` can inspect upstream response status. Request-only CEL expressions
no longer retry successful responses; reference response data to enable response-based
retries. An upstream dial failure leaves the request body open for the next attempt.

An upstream response with `Incremental: ?1` makes the proxy forward immediately,
as with `flush_interval -1`, and makes `encode` stream it. If `request_buffers` or
`response_buffers` prevents incremental forwarding, the proxy returns 501.
Set `proxy_status_name edge` to include a `Proxy-Status` header explaining the refusal.

### Logs, metrics, and tracing

Put `metrics` in the global options block, outside `servers`; `per_host` adds hostname
labels. With per-host metrics enabled, `observe_catchall_hosts` opts in to individual
host labels for catch-all traffic. Metrics can be pushed to an OpenTelemetry collector
using OTLP.

`log_append` can record `{http.response.body}` and the request body, including
`{http.request.body_base64}` for binary input. Its `early` option evaluates the value
before downstream handlers run. Use `log_level` with a matcher for request-specific levels:

```caddyfile
@healthchecks path /healthz
log_level @healthchecks DEBUG
```

With tracing enabled, access logs include `spanID`; handlers can read
`{http.vars.span_id}`. `OTEL_TRACES_EXPORTER` selects the span exporter.
Set `QLOGDIR` to a writable directory in the process environment for QUIC qlog traces.

### Reloads, admin requests, and builds

`SIGUSR1` rereads the configuration file specified on the startup command line.
Changing the running configuration through the admin API disables signal-based reloads.
Graceful shutdown waits for HTTP servers from previous configurations, allowing
long-lived responses begun before a reload to drain at exit.

For invalid configuration, `POST /load` returns 400 and a single valid JSON body
including any warnings. Reload clients can use the HTTP status to detect failure.
A remote admin request is allowed when any matching `access_control` permission permits it.

Custom builds need DNS provider modules updated for the libdns 1.0 beta APIs. Go 1.26 is the minimum
for builds using the 2.11.6 Caddy module, including plugins updating that dependency.
Plugin maintainers should update the dependency when an exported API they use changes.
`caddy list-modules --json` exposes the installed module inventory for scripts.

Files in this skill

  • SKILL.md5.3 KB
  • references/caddyfile-directives.md2.9 KB
  • references/logging.md1.3 KB
  • references/reverse-proxy.md792 B
  • references/server-options.md861 B
  • references/tls-and-certificates.md2.8 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.