# Caddyfile Studio

Paste a Caddyfile to see its site blocks, snippets ((name) and import) and matchers (@name) as a tree, with line-numbered findings for unbalanced braces and undefined references. You can also make reverse proxy, static site, SPA and www redirect templates.

- URL: https://tools.itlibra.com/en/caddyfile-studio
- On-device・No upload
- Last updated: 2026-10-26

## How to use

1. Paste a Caddyfile into “Check config” (or press “Try the sample”).
2. Under “Results”, read the syntax and reference problems (unclosed braces, undefined matchers and snippets) and the points to check, with line numbers.
3. Under “Structure”, check how the site blocks and snippets nest.
4. For a template, choose the content and enter a domain name under “Make a Caddyfile”, then copy or save it.
5. Before applying, run caddy validate on your server.

## Use cases

- Write a reverse\_proxy in Caddy 2 syntax in front of a Node.js or Python app
- Check the 301 redirect from www to the bare name
- Find a snippet name mismatch in import or a matcher that is not defined
- Check that tls internal is not used on a public site
- Prepare a static site with try\_files for a single page app

## What it does

### Site blocks, snippets and matchers

Counts the site blocks for each address, the (name) snippets and the @name matchers, and shows them as a tree with nesting.

### Reference problems by line

Lists a { with no matching }, a } with no opening, and @matchers or import targets that are not defined as errors.

### Checks following Caddy 2

Points out forms where automatic HTTPS does not apply (http:// addresses, IP addresses, auto\_https off), reverse\_proxy upstreams, tls internal, compression and the Server header, and directive order.

### Templates

Static site, reverse proxy, www to bare name redirect and SPA (try\_files), with your domain name.

### Nothing is sent

The pasted config is processed only in your browser and not sent to a server.


## Capability matrix

| Feature | Support | Notes |
| --- | --- | --- |
| List and tree of site blocks, snippets and matchers | Supported | — |
| Unclosed or unmatched braces, undefined matchers and snippets | Supported | — |
| Comparison with the list of Caddy 2 standard directives | Partial | Plugin directives are shown as unknown and are not judged wrong |
| Common mistakes (automatic HTTPS, reverse\_proxy, tls internal, order and others) | Partial | Based on typical patterns. It can raise false alarms and miss things |
| Converting an nginx config to a Caddyfile | Not supported | Not supported. Rewrite it in Caddy syntax |
| Reading the contents of files loaded by import | Not supported | Only the file names are listed |
| A real check with caddy validate, or connecting to a server | Not supported | Not run and no network access. Check with caddy validate before applying |

## Limits & notes

- Pasted input is limited to 300,000 characters, 20,000 directives and 64 nesting levels.
- Findings are a guide from tokens and structure. They can flag correct configs and miss problems.
- The directive list covers the Caddy 2 standard directives. Plugin directives are shown as unknown.
- The contents of files loaded by import are not read.
- Templates are examples. Change the upstream port, paths and domain name to your environment.
- tls internal is a self-signed certificate. Do not use it on a public site.

## Privacy & safety

The pasted config, the findings and the generated templates are processed only in your browser. They are never sent to or stored on a server.

## FAQ

### How do I write a reverse proxy in Caddy?

In “Make a Caddyfile” choose “Reverse proxy” and enter your domain name. Change the upstream 127.0.0.1:3000 to your app.

### How do I redirect www to the bare domain in Caddy?

In the site block for www.example.com, write redir https://example.com{uri} permanent. permanent means 301. Serve the site from the example.com block.

### When does Caddy’s automatic HTTPS not apply?

When the address starts with http://, when only an IP address or port is given without a host name, or when auto\_https off is set in the global options. “Check config” points these out.

### Does Caddy keep directives in the order I write them?

No. Caddy reorders directives by a default order before running them. Wrap rewrite or try\_files in route to keep their order. “Check config” lists combinations where this may matter.

### Does this replace caddy validate?

No. It only checks braces, references and a guide to common mistakes. Run caddy validate before applying.

### Is the pasted Caddyfile sent to a server?

No. It is processed only in your browser and is neither sent nor stored.
