Virtualmin instances behind load balancer

SYSTEM INFORMATION
OS type and version:CentOS Linux 7.9.2009 REQUIRED
**Webmin version:1.981 ** REQUIRED
Virtualmin version: 6.16 REQUIRED
Related products version: RECOMMENDED

Hello,

I’m setting up Virtualmin to run several instances behind a load balancer. For Apache to work properly I’ve have to set the virtual hosts using *, instead of the IP, because each instance will have a different IP. Like this:

<VirtualHost *:80>
ServerName firstdomain.example.com
#....
</VirtualHost>
<VirtualHost *:443>
ServerName firstdomain.example.com
#....
</VirtualHost>

<VirtualHost *:80>
ServerName newdomain.example.com
#....
</VirtualHost>
<VirtualHost *:443>
ServerName newdomain.example.com
#....
</VirtualHost>

Question is, how do I configure Virtualmin to automatically use * instead of the IP on the apache config?
Thank you

Virtualmin Configuration->Defaults for new domains->Address format for Apache virtual hosts

1 Like

Thanks a lot Joe!
One more thing, I’ve manually changed the apache config to * for a virtualserver that has SSL enabled.
I’ve changed both *:80 and *:443.
But after that, Apache loads a wrong certificate, from a different domain. Is there anything else I need to do?
Thank you!

They all must be switched, or you’ll never be able to guess which one will get served. Apache has consistent logic for how it decides what domain is the “best match”, but nobody but the developer than implemented it will ever understand it.

1 Like

It worked,
Thank you very much Joe!
Best,

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