Cloudflare DNS setup for ngrok HTTPS URL reddit / selfhosted ---------------------------------------------------------------------- djole0501 · 2023-11-23 23:11 I'm using ngrok to port forward my little Node Express web app to the internet, and I have set up a static domain for it on ngrok (as only one is available for the free plan), let's say `https://some-name.ngrok- free.app`. I have my own domain `example.com` registered and managed on Cloudflare, and I want to create a CNAME reroute from `subdomain.example.com` to the ngrok URL, so that when I go to `subdomain.example.com` I get the Express app. The problem is that no matter what I do I get a too many redirects error. I tried creating a CNAME record with and without Cloudflare proxy, same thing. Any ideas? Is this even possible to pull off with ngrok? I'd like to think that it is because it's just a simple redirect from a domain I own to another website. I'd like to add that I've managed to create an SRV record that does that exact same thing, but for my local Minecraft server that is port forwarded with ngrok through TCP, and I can connect to it using `minecraft.example.com` (for example). Thanks in advance! ---------------------------------------------------------------------- zfa · 2023-11-24 07:46 The problem is the fact that the requests are hitting ngrok but the hostname in the calls is still `subdomain.example.com`. ngrok cannot therefore determine where it's supposed to be forwarding traffic to. I've not used ngrok for a a long time but found these docs on how to use a custom domain with them. I assume it's a paid-tier offering: https://ngrok.com/docs/guides/how-to-set-up-a-custom-domain/ GL. ---------------------------------------------------------------------- djole0501 · 2023-11-24 14:41 It's honestly pretty impressive that they made it so this functionality is behind a paywall. It seems that the free .ngrok-free.app domain that ngrok provides is configured so that all CNAME redirects to it fail, but if you use a paid domain, which according to the docs ends in .ngrok-cname.com, those are ok with that use case. It seems that this is available for Cloudflare tunnel forwarded webapps, which makes sense as Cloudflare resolves it's own redirects, that did infact work. That's a shame for ngrok :/ Either way, thanks for your help! ---------------------------------------------------------------------- kokio_bbq · 2023-11-25 01:33 You can replace ngrok with Cloudflare’s tunnels https://www.cloudflare.com/en-gb/products/tunnel/