Anyone have a ready-made, tried and true, tested, Duplicati config for Caddy?

So I went and reinstalled Duplicati on a VPS host to test this. I got it working with the following Caddyfile:

duplicati.whitestrake.net {
  proxy / localhost:8200
}

The only drawback was that in later updates, Duplicati is very particular about which hostnames you’re allowed to access it from. Until you’ve configured it, it only allows localhost. This means that it can’t be proxied to by an external host until you’ve logged on locally, but you get an error:

The host header sent by the client is not allowed

Since my environment is Docker, I simply configured the Duplicati container with network_mode: service:caddy so that Caddy could reference it by localhost:8200, and you can browse to https://duplicati.whitestrake.net to see the result.

[edit: In retrospect, based on the wording of the setting and the error, I suspect that configuring the header_upstream Host localhost subdirective might get around this, too, but I didn’t actually test that.]

If you’re still having problems, post your Caddyfile and we’ll see if someone can figure out what might be causing them.


That said, with the way you mention the path /duplicati and the base URL setting, I’ve got a feeling you’re going to tell me you’re trying to put it in a subfolder. That’s not going to be easy at all, and you’ll notice that the config I posted originally and the one in this post both don’t use a subfolder, they give Duplicati the entire web root of a subdomain instead.

This issue pops up very frequently, and I’ve made a number of posts on the topic, the most recent being here:

The nginx config you posted by way of example would be the stopgap method 3 I mention there.

1 Like