Use Virtualmin to Redirect Domains to different VMs Local IP

6 posts / 0 new
Last post
#1 Tue, 10/01/2019 - 12:57
beyondimage

Use Virtualmin to Redirect Domains to different VMs Local IP

So I already have a VM running WAMP currently. It's DNS is being handled by cloudflare.

Since I'm running behind my home router, single IP and just port forwarding to a single VM. To minimize downtime, how can I have my webmin/virtualmin VM, take in ALL incoming requests for all 80 and 443 requests to my IP (through cloudflare and cloudflare's ssl) and have it redirect to my WAMP for domain A. Which I assume works the same for setting up another VM for hosting any other pages.

Also, can't find mod_proxy in the selectable options.

Thanks

Thu, 10/03/2019 - 13:24
scotwnw

Sorry, Not sure I can help on this one. One virtualmin server behind a router is easy. just forward ports. Multiple servers behind one ip complicates things. Add cloudflare on top of that and I'm sure its worse. Never used it though.

Thu, 10/03/2019 - 13:37
beyondimage

Well it appears that I'm trying to do what you originally used as an answer for that other post.

I'm trying to have virtualmin and multiple VPS on a LAN where virtualmin can redirect the domain names coming in, to their respective local IP. I was going to have some on the main virtualmin VPS but if it's easier to have one setup to just reroute the domain traffic to other VPS's then point me in that direction please. Thanks!

Thu, 10/03/2019 - 15:56
scotwnw

If it where a Lan only setup like I thought the other post was, then yea, that way would work for lan traffic. But adding outside access and having things get directed to right place is more complicated. Beyond my knowledge. Sorry.

Fri, 10/04/2019 - 09:14
noisemarine

I think you are asking about a reverse proxy server. I haven't heard of Virtualmin/Webmin having a module specifically for it, but it is generally just webserver configuration, so I guess they could. Probably more Webmin than Virtualmin, though.

Anyway, try starting with this: https://duckduckgo.com/?q=nginx+reverse+proxy&t=ffnt&ia=web

Tue, 10/15/2019 - 15:46
unborn
unborn's picture

@beyondimage

That is completely doable. I host my websites normally on server which manage its own dns. Then I have another small virtualmin server as separate box which I use for testing some scripts and as git server and also running virtualmin there with basic functions..

My setup works without problem without opening any port to second server which sits behind fw. You need to setup Site proxying which is in virutalmin settings.

For example if server1 is normal server listening on ports 80 and 443 then there create subserver with desired name example.your-real-domain.com head to proxy settings and then turn in on. in Destination field type http://ip-address-to-server2 if need it add specific port like this http://ip-address-to-server2:8081 and hit apply.

Now when you visit http or https://example.your-real-domain.com it should stay on that domain but it will display content of the redirected address from server2 which sits behind firewall without any ports redirected to it from outside world. however both servers must sits on same lan !! - can be on one public ip.. only one server needs opened ports. You can repeat the process for as many as you like be it domains or physical servers..

If you want hosts all other things on restricted one lan ip for example couple of 1.intranet and 2.intranet it is possible to run virutalmin on that ip.. however setup require one more step of editing one text file on primary server and thats it. just remember that anything hosted on restricted ip have to be managed internally or via ssh to primary server and then from there to ssh to restricted or vpn because its only web access you will get via proxying :)

I hope so this does make sense to you, if you want whassap (call is okay too) or email me or im in virutalmin irc chat room as well. I run setup like this secure for years.

Configuring/troubleshooting Debian servers is always great fun

Topic locked