1. Caddy version (caddy version
):
2.2.1
2. How I run Caddy:
a. System environment:
Ununtu 20.04.2, Docker
b. Command:
See docker-compose.yml
c. Service/unit/compose file:
version: "3.7"
services:
caddy:
image: caddy:2.2.1
container_name: caddy
hostname: caddy
restart: unless-stopped
ports:
- "80:80"
- "443:443"
environment:
- PUID=$PUID
- PGID=$PGID
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile:ro
- $CONFIGS/caddy/data:/data
- $CONFIGS/caddy:/config
networks:
default:
external:
name: caddy_net
d. My complete Caddyfile or JSON config:
domain.com {
route /netdata* {
reverse_proxy localhost:19999
}
}
3. The problem I’m having:
I cannot get netdata to proxy through caddy. It is running fine on its default port 19999. I have used this strategy to proxy other things locally hosted or other containers. For some reason not working with Netdata. I am new to Caddy v2.
4. Error messages and/or full log output:
{"level":"error","ts":1612393641.7975783,"logger":"http.log.error","msg":"dial tcp 127.0.0.1:19999: connect: connection refused","request":{"remote_addr":"10.0.0.11:60879","proto":"HTTP/2.0","method":"GET","host":"domain.com","uri":"/netdata","headers":{"Accept":["text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9"],"Sec-Fetch-Site":["none"],"Sec-Fetch-User":["?1"],"Sec-Fetch-Dest":["document"],"Accept-Language":["en-US,en;q=0.9"],"Cookie":["organizrLanguage=en; JSESSIONID=A3D7579FD29302039983007AEF3790FA],"Upgrade-Insecure-Requests":["1"],"User-Agent":["Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.96 Safari/537.36"],"Sec-Fetch-Mode":["navigate"],"Accept-Encoding":["gzip, deflate, br"]},"tls":{"resumed":false,"version":772,"cipher_suite":4865,"proto":"h2","proto_mutual":true,"server_name":"domain.com"}},"duration":0.001979163,"status":502,"err_id":"ewqz1c52k","err_trace":"reverseproxy.(*Handler).ServeHTTP (reverseproxy.go:441)"}
5. What I already tried:
I have used this same strategy to proxy things that are locally hosted on the system without issue. Not sure what’s up here.