Just to be unambigious, “it” here is the upstream app itself; Smokeping is issuing the redirect, and Caddy faithfully returns it to the downstream client.
As for why, it’s fairly simple; Smokeping appears to generate Location headers contextually aware of the Host
header the client used to access the site.
Smokeping sees a request for Host: 192.168.1.4
, which is true for Caddy, but not relevant for the actual client downstream - the client wants smokeping.dabase.com
.
You can pass through the Host
header, along with a few other useful headers for backend apps to get actual client-relevant information, with the transparent
preset for the proxy
directive.
https://caddyserver.com/docs/proxy#presets