Caddy Proxy Manager

Using CPM

Every save is checked by Caddy and applied right away. If Caddy rejects it, nothing is saved and you see the reason.

Proxy Hosts

Forward a domain to a service on your network, for example jellyfin.example.com to 192.168.1.20:8096.

Field What to enter
Source (domain names) One or more domains, separated by commas. Wildcards like *.example.com need a DNS plugin (Cloudflare steps, steps 2 to 4)
Scheme auto (recommended), https only, or http only (no certificate)
Upstream scheme How Caddy talks to your service: http://, https://, or https:// (self-signed) for services with their own untrusted certificate
Destination IP or host name with port, for example 192.168.1.20:8096
Advanced Extra Caddy lines for this host, for example basic_auth { ... }

The Headers, Snippets and Plugins tabs let you switch extras on or off for this host. A disabled host shows a 503 page.

Redirect Hosts

Send visitors from one domain to another, or block a domain with an error code.

Code Use it for
301 / 308 Permanent move (308 keeps the request method)
302 / 303 / 307 Temporary move
403 / 404 / 410 / 503 No redirect: return this error instead

Turn on Keep path and query to send old.com/page?x=1 to new.com/page?x=1.

File Servers

Serve a static website or a download folder.

  • Each host serves one Folder below the File server root (default /file_server). An empty folder means the first domain is used, for example /file_server/files.example.com.
  • Directory listing (browse) shows a file list for folders without index.html.
  • Click Files to manage files in the browser: upload (up to 2 GB, optionally extract .zip files), download (folders as zip), create folders and delete.
  • Deleting a file server host keeps the files.

Headers and Snippets

Reusable pieces of Caddy config, found under Options.

  • Headers: sets of HTTP headers, for example security headers.
  • Snippets: any Caddy config, for example basic_auth or encode.
  • Apply to all hosts: adds it to every host automatically. You can still switch it off for a single host.
  • Default templates: ready-made sets you activate with one click, such as sec_headers, compression, block_ai_bots and cloudflare_headers.
  • Snippets can show a Badge (text or a coloured dot) next to every host that uses it, so you see at a glance which hosts are protected.

Error Pages

Under Options > Error Pages:

  • Edit the built-in 404 and 503 pages, or click Restore default page. Choose the language of the default pages.
  • Unknown hosts decides what visitors see on a domain that points to your server but has no host: Caddy default, 404 page, No response (444), Redirect or Custom HTML.
  • Also catch HTTPS also covers HTTPS. Enter a Catch-all domain of your own. Use a wildcard like *.example.com to avoid certificate warnings (needs a DNS plugin, see the steps below).

Catch-all 404 page with Cloudflare

Goal: every unknown subdomain, for example https://typo.example.com, shows your 404 page with a valid certificate instead of a browser error.

Before you start:

  • Your domain (example.com in these steps) uses Cloudflare for DNS.
  • Ports 80 and 443 of your server are reachable from the internet.
  • Your Caddy has the Cloudflare DNS plugin. The all-in-one image already has it.

1. Point all subdomains to your server

In Cloudflare, open your domain and go to DNS > Records. Add a record:

Type Name Content Proxy status
A * the public IP of your server DNS only (grey cloud)

Add an AAAA record too if your server has IPv6. Records you already have, such as app.example.com, keep working: a named record always wins over *.

2. Create an API token

In Cloudflare, go to My Profile > API Tokens > Create Token and pick the template Edit zone DNS (or Create Custom Token):

Setting Value
Token name Caddy Proxy Manager
Permissions DNS: Edit and Zone: Read (under DNS & Zones)
Zone resources Include, Specific zone, example.com

Cloudflare API token with DNS: Edit and Zone: Read for one specific zone

Click Continue to summary, then Create Token, and copy the token. Cloudflare shows it only once.

3. Add the token to CPM

Go to Settings > Global. Under Certificates, paste the token in Cloudflare API token. Fill in the ACME email address if it is empty, then click Save.

4. Turn on the Cloudflare DNS plugin

Go to Plugins, click Cloudflare DNS, switch it On and save. Caddy now gets its certificates through Cloudflare DNS, which is the only way to get a wildcard certificate.

5. Set up the catch-all

Go to Options > Error Pages. Under Unknown hosts:

  1. Choose 404 page. Redirect and Custom HTML work as well.
  2. Switch on Also catch HTTPS.
  3. Enter *.example.com as Catch-all domain.
  4. Click Save.

6. Test

Open https://something-random.example.com. You should see the 404 page without a certificate warning. The first time can take a minute while Caddy requests the wildcard certificate. If it does not work, check Logs (source System) for certificate errors.

Good to know:

  • Only one level of subdomains is covered: typo.example.com gets a valid certificate, a.b.example.com and other domains do not. They still see the 404 page, but after a certificate warning. Caddy never requests certificates for unknown domains.
  • With a DNS plugin on, Caddy requests all certificates through Cloudflare. Every domain on this Caddy must be in a zone the token can edit. Add more zones to the token if needed.
  • Testing? Turn on Dry-run on Settings > Global first, so you do not hit Let's Encrypt limits.
  • Proxy status Proxied (orange cloud) also works, but then Cloudflare shows its own certificate to visitors. In that case set SSL/TLS in Cloudflare to Full (strict).

Audit Logs (history and rollback)

Every config that CPM loads into Caddy is saved here (last 50 versions), with time, user and what changed.

  • Details shows the changed lines and the full Caddyfile.
  • Load this version puts an older version back into Caddy. Note: the next change you make is built from the database again.
  • Re-apply (on the host pages) sends the current config to Caddy again, for example after Caddy was offline.

Logs

The Logs page shows system logs and access logs per host, live.

  • First set Logs to Caddy Proxy Manager on Settings > Global (preset in the all-in-one image).
  • Filter by source, level and search text, choose the number of lines, or download the result.
  • CPM keeps up to 10 MB per source on disk.

Up/down status

The proxy host list shows a coloured dot for the source and the destination of each host.

Dot Meaning
Green Responds (any 2xx, 3xx or 4xx)
Red Error 5xx, timeout (5 s), or connection/certificate error
Grey Not checked (for example wildcard domains)

Checks run every 30 seconds by default. Switch them off with the Up/down button above the list or change the interval on Settings > Global (10 to 3600 seconds).

Users

Under Settings > Users (administrators only):

  • Add users with name, email, password and language. Tick the administrator role to let them manage users.
  • All users can manage hosts and settings. Only administrators can manage users.
  • You cannot delete yourself or remove the last administrator.

Everyone can choose their own Language (9 languages) and Theme (light, dark or automatic) in the top bar.