1. The problem I’m having:
Apologies for my other deleted post, I managed to hit an unknown hotkey-combination to post the topic before I’d finished writing it, then couldn’t re-post as I hit rate limiting for new members.
I’m looking for pointers / advice / suggestions on what is good practise (or possible) when using Caddy (as a docker container) to reverse proxy to other docker containers as the backend but using HTTPS throughout with trusted certificates.
My theory was that Caddy would run in a Docker container and be part of two docker networks - public (Internet facing) and private. The containers behind Caddy would be a private network with no Internet access for security, so all public traffic would route through Caddy.My testing so far shows I can do most of this.
My query relates to the best way to have HTTPS from the Caddy container to the web servers behind it. Usingtls_insecure_skip_verify gets this working as Caddy obviously can’t trust a self-signed certificate on the other containers but is there recommended a way to get a certificate Caddy can trust on them? I’ve noted that a couple of articles in the Wiki specifically said the example was not putting Caddy in a container to make it easier to work with the certificates.
One thought is to use something like acme.sh to handle certificate generation at host level (which ignores one of the benefits of using Caddy) and use Docker volumes to put the trusted certificates into the relevant containers using docker volumes. A wildcard certificate would simplify things with just one certificate to renew. I’d also need to tie the reload of services in the docker containers as post-renewal actions with acme.sh.
I know the security risk of having HTTP or untrusted HTTPs for the traffic between the Docker Caddy and other containers is very low given it’s not even leaving the host VM but sometimes you it’s nice to figure out a challenge.
Thanks!
2. Error messages and/or full log output:
None
3. Caddy version:
Latest - 2.10 (not installed in production yet)
4. How I installed and ran Caddy:
N/A
a. System environment:
Docker running on Ubuntu 24 ARM
b. Command:
N/A
c. Service/unit/compose file:
d. My complete Caddy config:
No config yet