caddy_add_route
Add a route to Caddy with custom match conditions and handlers, enabling reverse_proxy, file_server, static_response, redirect, and any other handler.
Instructions
Add a route with full control over match conditions and handlers. Supports any Caddy handler (reverse_proxy, file_server, static_response, redirect, encode, headers, etc.).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| match | Yes | Array of match objects (e.g., [{ host: ['example.com'], path: ['/api/*'] }]) | |
| handle | Yes | Array of handler objects (e.g., [{ handler: 'file_server', root: '/var/www' }]) | |
| server | No | Caddy server name (default: srv0) | srv0 |
| terminal | No | Stop processing further routes after this one matches |