Proxying Admin site

1. The problem I’m having:

2. Error messages and/or full log output:

no error

3. Caddy version:

v2.5.2

4. How I installed and ran Caddy:

Docker with custom build

ARG CADDY_VERSION=latest

#FROM caddy:${CADDY_VERSION}-builder AS builder
FROM caddy:builder-alpine AS builder

RUN xcaddy build --with github.com/caddy-dns/cloudflare --with github.com/lucaslorentz/caddy-docker-proxy/v2

FROM caddy:alpine
#FROM caddy:${CADDY_VERSION}-alpine

COPY --from=builder /usr/bin/caddy /usr/bin/caddy

CMD ["caddy", "docker-proxy"]

a. System environment:

Docker debian

b. Command:

n/a

d. My complete Caddy config:

{
        debug
        admin :2019
        # enable Prometheus metrics endpoint https://caddyserver.com/docs/metrics
}

*.internal.domain {
        tls letsencrypt-{$CADDYHOST}@domain  {
                dns cloudflare {$CLOUDFLARE_API_KEY}
        }
        log

        @admin host admin-{$CADDYHOST}.internal.domain
        handle @admin {
                reverse_proxy localhost:2019
                metrics {
                        disable_openmetrics
                }
        }
}

5. Links to relevant resources:

When I curl the caddy host (drogo = eg https://admin-drogo.internal.domain) I do get a response:

promhttp_metric_handler_requests_in_flight 1
# HELP promhttp_metric_handler_requests_total Total number of scrapes by HTTP status code.
# TYPE promhttp_metric_handler_requests_total counter
promhttp_metric_handler_requests_total{code="200"} 30
promhttp_metric_handler_requests_total{code="500"} 0
promhttp_metric_handler_requests_total{code="503"} 0

Hundreds of lines like that.
But when I curl for the config: https://admin-drogo.internal.domain/config, I believe I’m supposed to get the runnig config, but all I get are the metrics again.

What have I done wrong in my caddy file.

Also with the caddy file I have, it should be listening on everything. WHen if I look at the running config I see "admin":{"listen":"tcp/localhost:2019"}

I’m not too worried about that if I can get the reverse proxying to work (mine is all internal access, nothing is exposed directly.)

That’s a very old Caddy version. Please upgrade to the latest, v2.8.4.

Your post has broken formatting. Please fix it, it’s hard to follow. Code blocks with ``` must be on their own lines, not at the end of a line.

1 Like

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