I currently have Virtualmin running on two servers, a dedicated server which acts as my "main" server and a cloud instance from DigitalOcean. I also have a second cloud instance that is just running the LDAP server and acting as a secondary BIND and Postfix slave.
I recently came across Varnish and after some testing I believe it will work well in my environment. What I'd like to do is set up another server that only runs Varnish, and then point its backends to my Virtualmin servers that are serving Web content via Apache/PHP.
So my question is, is there a way to change the DNS "A" record for only the addresses for domains that will be accessed over the Web? As an example:
- My dedicated server, we'll call it Virtualmin #1, hosts domain.com and domain2.org. It is my first backend in Varnish.
- My first cloud instance, we'll call it Virtualmin #2, hosts site.com and site2.org, and is the second configured backend in Varnish.
- My Varnish machine only runs Varnish and does not run anything else. The two Virtualmin machines, besides running Apache for the sites they host, also run DNS, mail, spam/virus filtering, mailing lists, the whole works.
Now, let's say that I want to put Varnish in front of both of my Virtualmin servers, so as indicated above I set the two Virtualmin servers to be Varnish backends. However, I still want the Virtualmin servers to handle e-mail, FTP, etc. for the sites they host, but I want the IP addresses for the Web portions, like www.domain.com, www.site.com, sub.domain.com, etc. to be pointed at the Varnish instance (but leave, for example, mail.domain.com back at Virtualmin #1).
Is this possible? If so, is there a way to automate this in Virtualmin?