I have enabled stats on my Caddyfile and they work great, but only when fetching from the host machine. If I try to fetch the metrics from the Prometheus machine, that is on another host in the same LAN, it does not work. This seems to be an issue with SSL and I would like to disable it.
Can you share evidence of that? We need to know your configuration to know where/how metrics are enabled. It makes a difference. As @vvic said, if you’re talking about the interface on port 2019, the default address on that is localhost only.
How do I change it to be non-localhost? Can’t it serve on the local IP? Meaning: 10.5.x.x or something, so that prometheus, on the same network, can call it.
You don’t need auto_https off for that. If you serve it on a different port, it’ll be HTTP unless you give Caddy a domain name. See Caddyfile Concepts — Caddy Documentation
It did not work until I’ve added auto_https off. I tried putting just the port, then LAN IP:9200, http://LAN IP:9200, and other combinations. Should I report a bug?
I don’t believe that. There’s definitely no bug with having a site block with just a port, that will always be HTTP unless you use the HTTPS port (i.e. :443)