Comment on Caddy touble in Docker

carlnewton@feddit.uk ⁨2⁩ ⁨weeks⁩ ago

Hey, I’m just guessing here because I haven’t used Caddy in Docker directly, but I do manage a project that uses FrankenPHP, which is essentially a wrapper for Caddy as I understand it, and I’ve had a problem that looks similar to this.

Caddy will attempt to generate an SSL certificate, and if you are using a reverse proxy, depending on how it’s configured, it will internally attempt to fulfil that certificate generation over port 443, which will fail, because it doesn’t have a configured SSL certificate. It’s the old catch-22!

The solution I have found is to temporarily internally serve your environment over port 80 for external SSL connections. This will allow Caddy to retrieve an SSL certificate and put it in place. After this, you should then be able to switch back over to port 443 for SSL connections internally, and it’ll use the certificate.

Once again – this is just a guess, and I don’t know the exact criteria in getting this going in Caddy, but it might be worth a try. In my FrankenPHP project at least, it was a matter of setting the SERVER_NAME variable to http://${DOMAIN}:80

original
Sort:hotnewtop