There is an “Edit Proxy Website” menu item in Server Configuration, which I think can do the thing for proxying. I think you’d just proxy to
http://localhost:3000 or whatever and make sure your app allows the hostname of the virtual server to reach it…in Ruby on Rails this might be set in
config.hosts in your
environments files, though I think some apps default to being accessible to anyone that can reach them. That’s not a Virtualmin question, though, and I am, by no means, an expert on Ruby on Rails. But, the Virtualmin side is pretty opaque, which is why it’s getting an overhaul, since nearly every modern web app needs to be deployed in the same way.
I believe I’ve used custom rules in my cases, which just look something like this (maybe with a Match rule added to make it skip
.well-known so Let’s Encrypt can work).
ProxyPass "/" "http://localhost:3000/"
ProxyPassReverse "/" "http://localhost:3000/"
Obviously if more than one app runs on the system, each will need its own port. Right now, we only handle protecting those ports from other users squatting on them for apps installed via Install Scripts, but that’s one of the features being worked on, along with a user-owned startup utility (so apps started on boot can be safely managed by non-root users).
Anyway, none of this stuff is really Virtualmin or Ruby on Rails specific. Every app is being deployed in some variation of this. You have an app server (puma in our RoR case) that runs the app, and you have a frontend server (Apache or nginx doesn’t matter) that proxies to it. No matter what language or framework, that’s pretty much how everybody is doing it, so when you read up on deploying modern web apps it’s always gonna be some minor variation on this theme. We’ve just been a little slow to adopt that as an obvious/clear/foolproof process in Virtualmin, due to my failure to communicate requirements clearly to Jamie mostly!