
Dec 23, 2025
By default, Caddy does not restrict request body size. You can easily enforce limits to prevent large file uploads or abuse.
This is especially important for:
File upload endpoints
APIs
Protecting server memory and disk
Example: Limit uploads to 10 MB.
example.com {
request_body {
max_size 10MB
}
reverse_proxy localhost:3000
}
Any request exceeding this size will be rejected automatically.
Example:
/upload → max 5 MB
Everything else → no limit
example.com {
handle_path /upload/* {
request_body {
max_size 5MB
}
reverse_proxy localhost:3000
}
handle {
reverse_proxy localhost:3000
}
}
This is ideal for APIs where only specific endpoints accept files.