Why is it redirecting to an IP whilst proxying?

I’m running Docker Hub with Caddy infront of it.

With the config:

smokeping.dabase.com {
    tls me@example.com
    proxy /
    log stdout
    errors stdout
    header / {
        X-Robots-Tag "noindex"

But it redirects to… why?

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:, 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.


1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.