ยง2023-07-07
Caddy directives are configuration instructions used in the Caddy web server to define how it should handle incoming requests and serve content. In Caddy, the server configuration is typically written in a Caddyfile, which is a plain text file containing a series of directives. Each directive represents a specific action or behavior that Caddy should take for a particular set of requests. Directives are structured in a block format, where each block begins with a keyword followed by its parameters and an associated block of subdirectives.
- Caddyfile
example.com {
root /var/www/html
gzip
log /var/log/caddy/access.log
proxy /api localhost:3000 {
transparent
}
tls {
dns cloudflare
}
}