A Traefik dynamic config builder that generates a v3 file-provider YAML with a router, a load-balancer service, optional TLS, and a stack of middleware. Describe the host, backends, and the protections you want, and copy a config Traefik can hot-reload — no process restart required.
How it works
Traefik’s dynamic configuration is organized under an http key into three sections.
A router carries a rule (built from matchers like Host() and PathPrefix(), joined
with &&), the entryPoints it listens on, the service it forwards to, an optional
tls.certResolver, and an ordered list of middlewares. A service defines a
loadBalancer with one or more backend servers by URL. Middlewares are reusable
request transformers.
The builder wires these together: it generates the rule from your host and path, lists each
backend URL, attaches only the middleware you enable, and emits matching middleware
definitions — a token-bucket rateLimit, a basicAuth stub, a redirectScheme to force
HTTPS, and a compress block. Backticks in rule values and correct indentation are handled
for you.
Tips and notes
- The
certResolvername must match one defined in your static config (the ACME section). This tool only references it; it cannot provision the resolver itself. - Middleware order matters. Putting
https-redirectearly means the redirect happens before auth or rate limiting, which is usually what you want. - Replace the generated
basicAuthuser hash with a real htpasswd value (htpasswd -nbB user pass). The placeholder will not authenticate anyone. - Set the
rateLimitaverageto your steady-state traffic andburstto absorb legitimate spikes; too low a burst will throttle normal page loads that fire several requests at once.