Ports for Cloudflare Tunnel

SYSTEM INFORMATION
OS type and version Ubuntu 22.04.4 LTS
Webmin version REQUIRED
Virtualmin version 7.20.2
Webserver version 2.202
Related packages Apache

Hey everyone, so I’m trying to set up Virtualmin by going through a Cloudflare Tunnel but I don’t know which ports and subdomains to set in the Public Hostnames, I have set up my admin page with the port 10000 and it’s working, but I don’t know which ports to use to get to the actual Virtual Servers / Websites. Thank you!

What do you mean by “get to the actual Virtual Servers / Websites” here?

So like, let’s say I have 2 domains. domain1 and domain2. Virtualmin is on the Managemnt domain, so in my Cloudflare DNS tunnel I have subdomain.domain1.com redirect to X.X.X.X:10000, and that’s how I have the admin portal working.

Now let’s say I create a new Virtual server with the domain2, when I try to add the entry to the Cloudflare tunnel, it’ll ask me for IP and Ports, so should I do X.X.X.X:443, X.X.X.X:80? And what about the webmail and other ports that Virtualmin needs?

You dont need to specify 80/443 in Cloudflare. Just add relevant A/CNAME records that point say, domain2.com, www.domain2.com, mail.doain2.com, etc to your server’s IP address and make sure the Cloud icon is orange so that the traffic is routed via Cloudflare.

You’re thinking of DNS Records, for Cloudflare Tunnel is a bit different. For example:

subdomain.domain1.com with Service X.X.X.X:10000 directs me to the login page for admin.
subdomain.domain1.com with Service X.X.X.X directs me “Bad Gateway Error 502” page.
(X.X.X.X is the server’s private IP)

Port 80.

You will add multiple domain names to the Cloudflare tunnels service and then point every domain to the IP address and port 80 of your Virtualmin server.

Virtualmin will serve the website / content of the appropriate domain as it is accessed by a visitor.

Every domain / virtual server on your Virtualmin system does not need to have a different IP address or port to use it with Cloudflare tunnels.

That’s all I needed to know, I’ll test that out tonight. Thank you!

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