DevTools Logo

Traefik Router Generator

Traefik Router Generator

Build deterministic Traefik v2 and v3 dynamic configuration in your browser

Routers

Services

Middlewares

About

Compose deterministic Traefik v2/v3 dynamic configuration entirely in your browser, with matching middleware references and rate-limit controls.

Examples

Host plus PathPrefix rule

Input
buildTraefikRule({ host: "api.example.com", pathPrefix: "/v1" })
Output
Host(`api.example.com`) && PathPrefix(`/v1`)

Host and path clauses compose with && using Traefik's backtick matcher syntax.

Rate-limited router

Input
generateTraefikConfig({ routers: [{ name: "api", host: "api.example.com", service: "backend", middlewares: ["limit"] }], services: [{ name: "backend", servers: ["http://127.0.0.1:3000"] }], middlewares: [{ name: "limit", type: "rateLimit", average: 100, burst: 20 }] })
Output
rateLimit: average: 100, burst: 20 + middlewares: - limit

The router references the limit middleware while the middlewares section carries the average/burst pair.

About this tool

Traefik Router Generator composes Traefik v2 file-provider YAML with generateTraefikConfig(config): routers render rule, service, optional tls: {} and middleware references in order, services render loadBalancer server URLs with passHostHeader, and middlewares render redirectScheme, basicAuth, rateLimit, stripPrefix, or headers blocks. Sections always emit in routers → services → middlewares order with an optional EntryPoints comment.

Rules are built with buildTraefikRule({ host, pathPrefix, headersRegexp }): Host, PathPrefix, and HeadersRegexp clauses use Traefik backtick syntax and join with &&, falling back to PathPrefix(`/`) when nothing is set. Values quote safely — plain tokens stay bare while strings with backticks or special characters JSON-quote — so identical inputs always yield identical YAML.

Rate limits clamp to non-negative integers (average/burst) and blank names fall back to router, service, and middleware placeholders. Everything is pure string building in the browser; hostnames, server URLs, and credential hashes never leave the device.

How to use this tool

  1. Define routers and match rules

    Set each router's host, pathPrefix, and optional header regexps — the rule composes them with && in backtick syntax.

  2. Point routers at services

    Name the backing service per router and list its server URLs, keeping the service name identical in both sections.

  3. Attach middlewares

    Add rateLimit average/burst, basicAuth users, stripPrefix prefixes, or redirectScheme entries, then reference them by name from the router.

  4. Enable TLS and copy the YAML

    Toggle tls for routers that terminate HTTPS, then paste the deterministic http: document into the Traefik file provider.

Use cases

Routing multi-tenant hosts

Split api.example.com/v1 from other hosts and paths with composed Host/PathPrefix rules.

Throttling public endpoints

Cap request bursts with average/burst rateLimit middlewares referenced from edge routers.

Protecting staging routes

Gate internal routers behind basicAuth user hashes without touching the service definitions.

Common mistakes

Mistake:Referencing a middleware name that is never defined.

Fix:Router middleware entries are plain name references — define the same name in the middlewares section or Traefik will fail to resolve it.

Mistake:Mismatching the router service name.

Fix:The service: value must equal a service section name exactly (blank falls back to service) — a typo leaves the router pointing at nothing.

Mistake:Expecting negative rate limits to error.

Fix:average and burst clamp with Math.max(0, …) instead of throwing — validate inputs yourself if negatives must be rejected.

Frequently asked questions

What does this tool do?

It builds Traefik v2 file-provider YAML with generateTraefikConfig (routers → services → middlewares) and match rules with buildTraefikRule: Host, PathPrefix, and HeadersRegexp clauses in backtick syntax joined by &&, with redirectScheme, basicAuth, rateLimit, stripPrefix, and headers middlewares.

How do tls, service refs, and rate limits behave?

tls: true adds a tls: {} block to the router; the router service value must exactly match a defined service name; rateLimit average/burst clamp to >= 0 instead of throwing.

Is my config uploaded or stored?

No. Rule composition and YAML rendering run entirely in your browser — hosts, URLs, and credential hashes never leave your device.

Why is my rule quoted in the YAML?

Rules contain backticks, which fall outside the bare-token charset, so they JSON-quote on the rule: line. The raw buildTraefikRule return stays unquoted for copying into other providers.

References & standards

.env Secret Safety Linter

Validate .env syntax and spot likely leaked credentials or placeholder secrets.

.htaccess Generator

Build an Apache .htaccess — HTTPS redirects, rewrites, error pages, security headers, and basic auth

2D Fluid Dynamics & Particle Physics Sandbox

A physics playground with two engines sharing one canvas. The fluid mode runs a real Eulerian Navier-Stokes solver — semi-Lagrangian advection, explicit diffusion, Jacobi pressure projection and vorticity confinement — that you paint with dye and velocity using mouse or touch. The particle mode is a damped Verlet N-body engine with gravity wells, Coulomb attractors and repulsors, spring links, wall restitution and elastic circle collisions. Particle counts adapt to the device (100k target on WebGL2 desktop, 2k-5k on CPU fallback), and every configuration exports as runnable code: a Matter.js world, a PixiJS ticker setup, or a standalone vanilla Canvas engine.

AI Function Calling Schema Generator

Generate function calling JSON schemas from TypeScript interfaces

Algorithm Arena & Data Structure Visualizer

Interactive arena for algorithms and data structures: eight sorting algorithms racing on one seeded input, six pathfinding algorithms walking generated mazes, and BST, AVL, Red-Black, B-tree, heap and trie operations replayed step by step with rotations highlighted. Every run shows the Big-O table and the phase-highlighted reference implementation in four languages, and compared values can be played as pitch (sonification) through the shared audio engine. Everything runs client-side; inputs never leave the browser.

Ansible Playbook Generator

Build an Ansible playbook — hosts, vars, and tasks with modules — as YAML