I know I got the values that go inside {} came from somewhere, but I can’t recall where. I was sure this was on the Caddy docs somewhere, but I can’t find it.
header_up X-Forwarded-Host {hostpost}
This one looks like it’s probably wrong…which is why I was trying to find this info again.
Caddy’s placeholders are a bit fragmented in the documentation, because each execution context may set its own placeholders. Not all placeholders are always available.
Here’s a list of all the HTTP placeholders:
Here’s a list of the Caddyfile placeholder shortcuts (exclusive to the Caddyfile):
Pretty certain {on} does not exist as a placeholder in Caddy.
To add to this, you also do not need the header_up X-Forwarded-Proto {scheme} line. You should be getting a warning for having that because it’s already set for you.
Technically the default behavior of Caddy’s proxy is to pass the Host header unchanged to the upstream. The {host} placeholder is just the hostname portion, omitting port if any. Slightly different, but only sometimes.