CNAME Header Problems

Hello, I have some basic knowledge on how HTTP works, but by far not enought to resolve my problem:

I have one subdomain. (“stats.kis.intranetproject . net”) which has a A-Record set to the IP of the Server (Caddy will be the only webserver running there).

Now I also have another domain kisdemo.intranetproject. net which has a CNAME-Record to “stats.kis.intranetproject. net”. In our software we save the customers data under a internal name with is assoziated with the subdomain over which he want’s his instance to be available (This would be “kisdemo.intranetproject. net” in my example case). So whenever a domain connects to the Website we need a Header to see where the Request Originally came from. Also I can’t set each address (the ones like kisdemo…) in the Caddyfile itself by hand.

So my question is: How am I able to say to Caddy to accept every domain request (because by entering “kisdemo…” caddy will say that host is not being served).

My concept is probably pretty similar to’s one, but I can’t say for sure since I don’t know their source code :slight_smile: But if you enter a custom subdomain the “:autority” header gets filled with the origin request host… I have no clue how that is working…

Some really good advice is needed as you can see, I’m struggeling really hard since the last few days.

Hi @bennetgallein!

You could either add to your list of labels for the site you want to serve - or, you could use wildcards to have Caddy answer all requests that match, such as *… Or something to handle literally all requests by default, with automatic HTTPS on demand:

http:// {
  redir https://{host}{uri}

https:// {
  # Handle all requests not matching other sites
  tls {
    max_certs 10

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