Unable to access agents via Caddy reverse proxy. #4282
-
🔍 Check for existing issues
How is Dozzle deployed?Agents 📦 Dozzle versionv8.14.10 ✅ Command used to run Dozzledocker compose up -d Host docker-compose.yml: Agent docker-compose.yml: Caddyfile: 🐛 Describe the bug / provide steps to reproduce itI've set up Dozzle on two seperate networks, one as host and one as an agent. I've followed the agent guide to no avail. They both work fine as stand alone instances, but if I attempt to set one as an agent and use caddy (v2.6.2) as a reverse proxy it fails. I've tried to troubleshoot with ChatGPT and it suggests it's due to caddy sending a html page rather than the expected JSON. I've searched on line and tried the caddyfile config located here and more than a dozen suggestions from ChatGPT, as well as the I can confirm it works if I bypass Caddy and use http://IP-ADDRESS:PORT as the DOZZLE_REMOTE_AGENT value , but I'd rather not go that way for security reasons. Am I missing a config for Dozzle or is this purely down to Caddy misbehaving? 💻 EnvironmentHost Environment: Agent Environment: 📜 Dozzle logs are required for debugging purposes. You may need to enable debug mode. See https://dozzle.dev/guide/debugging.Host Logs: 📸 If applicable, add screenshots to help explain your bugNo response |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
|
This is not a bug so moving to discussion. |
Beta Was this translation helpful? Give feedback.
-
|
Dozzle uses gRPC. So a reverse transport wouldn't work as it is designed for HTTP. However, according to Claude, you should be able to use You'll also want to handle flush intervals and timeouts. This is not tested and I am not sure if it will work. I would recommend searching for "reverse proxy with Caddy for gRPC" and seeing if that yields better results. Let me know how it goes. I can probably do a quick test later this week if I get time. |
Beta Was this translation helpful? Give feedback.
-
|
I've spent a several hours today trying to troubleshoot this issue and as far as I can tell I'm no closer to getting it working. I just can't figure out why Caddy isn't sending the expected response. I can get agents working locally using internal IPs, e.g. 192.168.x.x. However, getting them working through cloudflare and caddy so I don't need to expose/open any ports just doesn't work. I'm not sure what to try next so any suggestions when you have time would be greatly appreciated. |
Beta Was this translation helpful? Give feedback.
I figured it out. However, it might not be the solution you want. Caddy is treating the gRPC call as HTTP, so it's trying to decrypt it before sending it to Dozzle. It can't do that because Dozzle's certificates are private. When Caddy sees the SSL request, it fails because it can't perform the proper handshake.
The right solution is to enable layer 4 proxy which just forwards raw TCP.
I was able to test it with:
Layer 4 is not built in the default binary. You would have to build a custom binary at https://caddy…