1. Caddy version (caddy version
):
2.4.6
2. How I run Caddy:
Docker file (see below)
a. System environment:
Ubuntu 20.04
b. Command:
docker-compose up
{
on_demand_tls {
ask http://railsplatform:3000/caddy_domain
interval 2m
burst 5
}
}
https:// {
tls {
on_demand
}
reverse_proxy railsplatform:3000
}
Ok so I have the above configuration so far, I haven’t actually run it on the server just yet as I am still setting this up.
So I want my Caddyfile to be able to server requests for the following:
- Marketing website: example.com (or www.example.com)
- Customer domains which will create a DNS entry to point to: platform.example.com
So my Caddyfile will serve requests for the market website example.com, which should proxy requests to railsmarketing:3001.
My customers will make DNS entries to point to platform.example.com, these domains will need to use the on-demand lookup to verify that this domain should fetch a SSL certificate for. Requests for these domains should be proxied to a different backed like railsplatform:3000
My marketing website will also need a SSL certificate for example.com
What changes does my Caddyfile need, b/c currently it will proxy all requests to a single backend.
Thanks!