Managing redirects in Caddy at scale: from redir to a dashboard

December 1, 2026
4 mins read

Caddy makes redirects easy. One line in a Caddyfile and you're done. That holds until the list grows, a site migration lands, or the person who needs to change a redirect is in marketing and has no business on the server. This guide covers both cases: what Caddy does on its own, and how to hand redirect management to a dashboard while Caddy keeps serving every request.

Caddy's built-in redirects#

For a few rules, use redir:

Caddyfileexample.com {
    redir /about-us /about permanent
    reverse_proxy localhost:8080
}

For a longer list, a map keeps the rules in one place:

Caddyfileexample.com {
    map {path} {new_path} {
        /about-us     /about
        /old-pricing  /pricing
    }
    @moved expression `{new_path} != ""`
    redir @moved {new_path} permanent
    reverse_proxy localhost:8080
}

If this covers you, stop here. You don't need anything else.

When it stops being enough#

  • Volume. A migration can mean thousands of old URLs, and they all have to live in config files.
  • Many sites or servers. The same rule set gets copied by hand across Caddyfiles and machines.
  • Who edits. SEO specialists, merchants and marketing teams need to change redirects, but they shouldn't get server access or need a reload.
  • Visibility. After a migration, the URLs you missed show up as 404s in logs nobody reads.

caddy-redirects: RedirHub manages, Caddy serves#

caddy-redirects is an open-source Caddy module (Apache-2.0, the same license as Caddy). You manage redirects, short links and QR codes in RedirHub, and Caddy serves them from your own server. Visitors never pass through RedirHub, and your DNS stays where it is.

Set it up in four steps#

  1. Get Caddy with the module. Pick github.com/redirhub/caddy-redirects on Caddy's download page, or run caddy add-package github.com/redirhub/caddy-redirects, or build it yourself with xcaddy build --with github.com/redirhub/caddy-redirects. Check it with caddy list-modules | grep redirects, which should list http.handlers.redirects and tls.permission.redirects.
  2. Copy your rules address and key. In RedirHub, open the Integration key panel.
  3. Add a redirects block to your Caddyfile (example below). One workspace rules address covers every domain on that server.
  4. Connect the domain. In RedirHub, set the domain to use your own platform. Caddy answers a check path on the domain, and RedirHub shows it as Connected.
Caddyfile{
    # Optional: on-demand certificates only for hostnames in your RedirHub rules
    on_demand_tls {
        permission redirects
    }
}

https:// {
    tls {
        on_demand
    }
    redirects {
        rules_url https://rules.rediredge.com/abc123/TOKEN.txt
        key {env.REDIRHUB_INTEGRATION_KEY}
        report_404 all
    }
    reverse_proxy localhost:8080
}

Options:

  • rules_url (required): your workspace rules address.
  • key: your integration key. Without it, redirects still work but nothing is reported.
  • report_404 rules|all: rules (the default) follows each hostname's "Report 404 pages" setting. all reports every 404 on every hostname the site block serves.

The redirects directive runs before redir, rewrite, uri, try_files and the handlers that serve your site.

How it behaves#

  • Updates. A change in the dashboard reaches Caddy within a second or two through a push signal. If the push connection drops, Caddy checks for changes every minute.
  • Your site comes first. Exact redirects run before your own routes. A domain-wide catch-all only applies when your site returns a 404.
  • Fails open. On any error, the request goes to your site unchanged.
  • Restarts. Caddy keeps the last good copy of the rules on disk and redirects as soon as it restarts, even if the rules can't be fetched.
  • TLS stays with Caddy. With the optional permission module, on-demand TLS issues certificates only for hostnames in your rules. RedirHub issues no certificate for these domains.
  • Easy to spot. Redirects carry the header X-Powered-By: RedirHub (integrated).

What is sent to RedirHub#

Redirect hits, plus the site's 404s under each domain's Report 404 pages switch (on by default). They're sent in the background in small batches, with a 2-second timeout, and dropped on failure, so reporting never slows a request. These reports feed per-redirect analytics. The 404 reports are where you catch URLs you missed after a migration.

Limits#

  • Up to 50,000 rules per domain.
  • HTML pages (custom HTML, 404 and cloud pages) need a DNS connection to RedirHub, and wildcard domains aren't supported in this mode.
  • Frame links are supported from version 0.4.0: the address bar keeps your domain. Password-protected links and links with several destinations become plain redirects. Paused or expired links aren't applied.

Frequently asked questions

No. Caddy serves every request. RedirHub only hosts the rules file and receives the reports.

Caddy keeps redirecting from its last good copy of the rules, and every other request goes to your site as usual.

Yes. The module runs first, and anything it doesn't match goes on to the rest of your config.

The format is an open specification: github.com/redirhub/integration-spec.

Krisbo

Krisbo is the founder of RedirHub, a modern URL redirection platform built for marketers, developers, and growing businesses. He writes about SaaS, growth, AI, infrastructure, and the systems behind building internet products at scale.