Skip to content
100% local

Nginx config to Caddyfile

Convert an Nginx server configuration to an equivalent Caddyfile.

Input
Output

Nginx config to Caddyfile

Paste an Nginx configuration and this tool rewrites it as a Caddyfile, keeping the structure recognizable: each server block becomes a Caddy site address, and each location becomes a handle block matched on the same path. It is built for the common migration case — moving a working Nginx site to Caddy without re-learning the syntax from scratch.

The options control which parts get converted. Reverse proxy turns proxy_pass into reverse_proxy and carries proxy_set_header entries over as header_up, substituting Nginx variables like $host and $remote_addr for Caddy placeholders. Static files maps root, index and try_files to root, file_server and try_files. Redirects & rewrites turns return and rewrite into redir and rewrite, and TLS settings carries a certificate pair into a tls directive — worth noting, since Caddy issues and renews certificates automatically and that line is often removable. Compression & caching maps gzip to encode and flags proxy_cache, which has no built-in Caddy equivalent. Body size limit converts client_max_body_size into a request_body block with a matching max_size.

Nginx has directives Caddy simply doesn't, from SSL protocol pinning to auth_basic_user_file. Rather than guessing, the tool leaves those untouched and adds a commented note on what has no equivalent and what to check by hand — turn that off for plain output. Nested blocks parse correctly, so a location nested inside another location, or a server wrapped in an http block, comes through the same way. Both line-ending styles are handled, and the live tally reports lines in, directives converted and warnings raised.

Everything runs locally in your browser — your configuration is never uploaded anywhere, which matters when it contains internal hostnames or certificate paths. Copy the result, download it as a Caddyfile, or send it back into the input to refine the conversion further.

FAQ

Does it handle a full nginx.conf with multiple server blocks?
Yes. Every server block — whether at the top level or nested inside an http block — becomes its own Caddy site block, separated by a blank line.
What happens to directives Caddy has no equivalent for?
They are left out of the converted output and flagged with a "# CADDY:" comment explaining what to review by hand. Turn off "Warn about directives with no equivalent" to get plain output without the comments.
Does it remove my SSL certificate directives?
It converts ssl_certificate and ssl_certificate_key into an explicit tls directive, with a note that Caddy can usually manage certificates automatically instead — you can delete that line and let Caddy handle HTTPS on its own.
How are regular-expression locations converted?
A location matched with ~ or ~* becomes a named path_regexp matcher (like @match1) used by a handle block, since Caddy does not do regex path matching inline the way Nginx does.
Is my configuration uploaded anywhere?
No. The conversion runs entirely in your browser — your Nginx configuration never leaves your device.