Web Tools DocGuides

How to use Caddyfile Configuration Generator

Get the best out of Caddyfile Configuration Generator: every option explained, a worked example, and what to check when the output is not what you expected.

Updated July 31, 2026

What it does

Build production-ready Caddyfile configs for reverse proxy apps and static sites with secure defaults. It runs entirely in your browser — your input never leaves your device.

Options

Every setting this tool exposes, straight from the code that validates it.

OptionTypeDefaultWhat it does
siteModeone of: reverse-proxy, staticreverse-proxyDefaults to reverse-proxy.
domaintextapp.example.comDefaults to app.example.com.
emailtextops@example.comDefaults to ops@example.com.
rootPathtext/srv/www/appDefaults to /srv/www/app.
upstreamtext127.0.0.1:3000Defaults to 127.0.0.1:3000.
enableCompressiontrue / falsetrueDefaults to true.
enableSecurityHeaderstrue / falsetrueDefaults to true.
enableSpaFallbacktrue / falsefalseDefaults to false.

Worked example

Run these settings on the tool page:

  • siteMode: reverse-proxy
  • domain: app.example.com
  • email: ops@example.com
  • rootPath: /srv/www/app
  • upstream: 127.0.0.1:3000
  • enableCompression: true
  • enableSecurityHeaders: true
  • enableSpaFallback: false

You get:

app.example.com {
  tls ops@example.com
  encode zstd gzip
  header {
    X-Content-Type-Options nosniff
    X-Frame-Options SAMEORIGIN
    Referrer-Policy strict-origin-when-cross-origin
    Permissions-Policy geolocation=(), microphone=(), camera=()
  }
  reverse_proxy 127.0.0.1:3000
}

Getting the result you want

Most of the control here is in the options above. If the output is not what you expected, the setting to check first is siteMode and domain — those change the shape of the output rather than the input it accepts.

Troubleshooting

  • It is slow on very large input. Everything runs in your browser, so speed depends on your device. Very large inputs are best split up, or run through the API where the work happens on our servers.

Automating it

The same logic is available as a REST endpoint, so you can run it from a script, a CI job or your own app.

Bash
curl "https://api.toolsxpo.com/v1/caddyfile-generator" \
  -H "Authorization: Bearer $TOOLSXPO_KEY"

It costs 1 credit per successful call. See the full endpoint reference, or try it in the playground.

Tools covered here

Caddyfile Configuration Generator

DevOps & Config

devops

Related