I am using Caddy as an entrypoint on my server where I have a backend that handles requests of clients.
I may receive requests from domains like:
- assets.sport.com
- files.app.sport.com
- files-cdn.blabla.ch
- assets-cdn.hey.app.uk.co
So I need a way to redirect all traffic from (assets|files|assets-cdn|files-cdn).*
to my webserver (127.0.0.1:8080).
I tried to use assets.*
in my caddyfile for ex. (and replicating other entries) but I get this error when I run caddy reload
: "Error: adapting config using caddyfile: subject does not qualify for certificate: 'assets.*'".
I know I can redirect all traffic to my webserver but I would like to avoid sending him unnecessary traffic (domain not matching my pattern).
Does someone have any idea on how to put this in place?
Thanks!