Setting up multiple Reverse Proxy sites / sub-domains from default site

SYSTEM INFORMATION:
OS type and version: Rocky 9.1
Virtualmin version: 7.5 GPL

I have a TrueNAS running a handful of FreeBSD jails, each with their own web-based application, and a single jail running Caddy webserver acting as a proxy for the other jails / apps. At the moment, the Caddy server has several proxies set up to go to other apps / sites (i.e. - cloud.mydomain.net goes to a Nextcloud install, photos.mydomain.net goes to a Piwigo install, console.mydomain.net goes to the control panel for the TrueNAS, etc.). So far, so good.

Because the various apps are 1) already set up, and 2) file-size intensive, I’d prefer to keep them in the FreeBSD jails where storage and management is easier than building a new Host in Virtualmin and moving them over to it. (Also, I can’t move the control panel for the TrueNAS itself…).

What I am looking to do is set up the reverse proxies on my Virtualmin host, then take down the old Caddy server and move Virtualmin into its IP, keeping continuity for browsing / DNS. Before I can do this, I would like to set up the Reverse Proxies for the websites.

Looking in Virtualmin => Services => Configure Website, I can see there’s a UI to add a single proxy to the default site. My question is, is it possible to add multiple proxy sites?

cloud.mydomain.net => 10.0.0.242
photos.mydomain.net => 10.0.0.243

In an absolute pinch, I could move my various apps into Virtualmin hosts, but would prefer to avoid this if possible.

I did look this up prior to posting, which got me to the Proxy item in the Virtualmin GUI - the trick now is setting up more than one Proxy.

Thank you for the help and guidance!

Of course, after I post this, I had a possible solution.

Is the proper process to make a new Virtual Host for each site, and then each site is a 1 to 1 proxy for the corresponding app?

You definitely do not want a new IP for every app or domain. That’s asking for trouble. Name-based hosting is what Virtualmin is for. So use names, not IP addresses.

And, yes, if you have multiple websites, make multiple virtual hosts (domains) in Virtualmin.

Those IPs are local on my own network - each app is in it’s own Jail (the FreeBSD version of a VM, but “lite” version). I wouldn’t be assigning each a new, public IP, or an IP from Virtualmin.

I think I see now - I’d need to make a new Virtualmin server with the FQDN I want to use, then proxy it to the local IP of the Jail. I’ll give it a shot this weekend, and see if it works the way I need it to.

Ah, I see. OK, Virtualmin would be handling name-based VirtualHosts, and then the proxy rules would point to different apps running in different jails on different IP addresses. That’s fine. A little complicated (you could also run them in containers directly on the Virtualmin system), but perfectly reasonable.

Yeah, the trick is, because some of those apps let me do things like drop large batches of photos directly into the file system via an SMB share, then process them and serve them up via the Web GUI, I want to keep them native where they are now on the TrueNAS.

OK, new challenge. So far I have:

  1. Shut down my old Proxy server, and moved the Virtualmin VM to the old Proxy’s IP address
  2. Verified DNS is working properly, all names now resolve to the Virtualmin VM
  3. Created a new virtual server for each app I want to proxy
  4. Created a new virtual server for a handful of apps that don’t need to be proxied (OpenSpeedTest)
  5. Set up a Proxy on the three servers that I want to proxy for their apps

Of the three, one works (kinda, I need to troubleshoot NextCloud I think).

The other two give the default landing page for Virtualmin, instead of forwarding to the intended site. I can browse the sites via IP, but when I type the URL, it gives me the splash page instead:

https://photos.aiskon.net

Any idea why one site seems to work, but the other two do not?

maybe use the Website Proxy Settings in VM, although that will need a URL

For now, I’ve reverted back to my original Proxy server until I can get this figured out. I’ll see if I can tinker with it on the side until I can get the Proxy working.

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