caddy_adapt
Convert Caddyfile, nginx, or YAML configs to Caddy JSON without loading them, to preview the adapted output or port existing configurations; returns JSON and warnings separately.
Instructions
Convert a config in any registered adapter format to Caddy JSON without loading it. Useful for previewing what a Caddyfile produces, or for porting from nginx/yaml configs when Caddy is built with the matching adapter module ('caddyfile' is built-in; 'nginx', 'yaml', etc. require their adapter modules to be compiled into the Caddy binary). Returns the adapted JSON and any warnings separately.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| config | Yes | The raw config text (e.g., Caddyfile contents, nginx.conf, yaml) | |
| adapter | No | Config format adapter. Must match an adapter Caddy was built with. Built-in: 'caddyfile' (default). Common external adapters: 'nginx' (caddy-nginx-adapter), 'yaml' (caddy-yaml). | caddyfile |