How to set up subdomain through a tunnel?

Can someone point me to the exact instructions on how to configure Cloudflare to route an added subdomain through a tunnel?

Setup: I have a server that I have verified can handle localhost and mysubdomain.localhost traffic correctly. Cloudflare is already setup to handle foo.com and point it to my sever and this is verified to work.

From the docs I have read, if I have this server already these are the steps that appear to be recommended:

  1. Create a CNAME DNS Record with name “*” and content “foo.com
  2. ??? In the SSL/TLS menu, create a custom hostname: mysubdomain.foo.com
  3. ??? On the server, edit ~/.cloudflared/config.yml and add a new hostname for mysubdomain.foo.com in the ingress section
  4. ??? Some other step ???

I’ve tried 1,2, and 3 and no traffic makes it to my machine - it stops on the Cloudflare servers.

There is no difference between a domain and a subdomain. They are both treated as hostnames.

Therefore, your subdomain CNAME record should look just like any other Tunnel CNAME record. It should point to the tunnel ID hostname. Then your config file should just have one more entry with the new hostname that points to the local endpoint. And you shouldn’t need a custom hostname.

Thanks for the reply. I tried deleted my custom host name and modified my DNS records to look like this:

The subdomain is still not working, and I’ve also tried “handshigh” (my subdomain) instead of “*” and that doesn’t work either.

Is there a way I can directly monitor the tunner on the machine via the command line? I’ve been looking through the docs and haven’t found a way to do that.