Reverse proxy for containers and regular hosts?


I’m planning to use caddy-docker-proxy to reverse proxy my Docker containers. Is it possible to use the same Caddy instance in order to reverse proxy to web services on other hosts? (all using Let’s Encrypt certificates) Preferably using API.

If not, what’s the second best solution? I want to be able to point my domains to the same IP address, no matter whether the backend is served from a container or no.

What I have done before is use nginx and reverse proxy the default host to the nginx-proxy Docker proxy, but since TLS is terminated in the “frontend” nginx, I essentially need to duplicate the configuration for every container for which I want HTTPS.

Yes, you can provide a base Caddyfile to CDP. See the README.

API controlled instance not possible, then?

CDP is designed to generate Caddyfile config dynamically from running containers.

If you want to use JSON config via the API, then CDP is not the tool for you.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.