I have setup a server in my home for my home automation/hobby projects. Since the NAT condition in my country is really bad, I cannot get a public IP so I can access the machine from where ever I want. So, I thought of using Argo Tunnels to overcome this. Since I want the domain to be used for other stuff, I created the Cloudflare Tunnel with the address board.nmasnadithya.xyz which talks to NGINX on my server. This works fine both with & without SSL.
I have added a CNAME record to *.board.nmasnadithya.xyz to point to board.nmasnadithya.xyz so I can have talk to all my services running on my server using subdomains. I have configured nginx to proxy the subdomain properly. All the subdomains work if used without ssl (ex: plex.board.nmasnadithya.xyz), but doesn’t work with ssl due to the certificate they present is for ssl881653.cloudflaressl.com, *.cftunnel.com, cftunnel.com.
I tried adding a Cloudflare origin certificate generated for board.nmasnadithya.xyz & *.board.nmasnadithya.xyz to Cloudflare Tunnel config and nginx. But still it’s not working. I have no idea what to do next.
You also need to generate an argo tunnel token and append it to the bottom of the cloudflare origin certificate. You can get this argo tunnel token by running cloudflared login, download the cert.pem file, then simply replace the first two entries with what you have in the origin cert.
Yeah this is what I did. Everything works fine for the domain I created the tunnel for(board.nmasnadithya.xyz). But the subdomains only work with http. When I use https I get the above mentioned error.
Did you add page rules for 2nd level subdomains? If Not then add and try.
There page rule should be like this: