I’m seeing a “Bad gateway 502” error when trying to connect to the server. Explicitly setting the scheme to http://www.example.io makes it work, and I want to understand why.
This is really more of a question for Traefik than for Caddy.
FYI, you can probably entirely replace Traefik with Caddy by using caddy-docker-proxy. It’s a plugin which makes it possible to configure Caddy via Docker labels:
This would heavily simplify your setup, because then you’d only have one web server instead of two, and you’d get the benefits of Caddy’s more resilient ACME implementation.
Ah, on a second reading, I realize you meant http:// in front of the site address in your Caddyfile. That was kinda ambiguous.
But yes. Caddy defaults to listening on the HTTPS port, even if you turn off auto_https. So specifying http:// forces it to use the HTTP port instead. You could also append :80 instead of using http:// if you wanted, for the same effect (just for the sake of example).
My point about using caddy-docker-proxy still stands though – it should greatly simplify your setup by using that.
Cheers, the info that Caddy defaults to listening on HTTPs is what I must have missed reading the docs. Regarding traefik vs caddy as proxy: How’s caddy’s ACME implementation more resilient? Also, by first looks of it, traefik seems much more powerful as a reverse proxy.
Caddy supports multiple ACME backends simultaneously, so if there’s a problem with one, it will fall back to the other. Caddy supports both Let’s Encrypt and ZeroSSL by default. Also, Caddy’s handling and avoidance of rate limits is much stronger. Caddy performs OCSP stapling, improving the general performance of the web, and will automatically notice if its certificate was revoked and renew it automatically (not unheard of, if an ACME CA makes a mistake, it’s happened to both Let’s Encrypt and ZeroSSL).
What are you noticing that Traefik does that Caddy doesn’t? Caddy’s reverse_proxy module is very powerful.