在负载均衡器后面配置 Apache VirtualHosts

Configure Apache VirtualHosts behind a Load Balancer

我有两台服务器,私有 IP,Apache 2.4。我在两台服务器上提供相同的内容,并且在这些服务器前面有一个负载平衡器。

负载均衡器使用 public IP,并且有一个域 (mycompany.com) 与之关联。

但是,客户购买了一个新域并希望使用相同的服务器来提供新内容。

据我所知,我需要配置 VirtualHosts。我已经阅读了有关 VirtualHosts 的文档,这似乎是基于名称的虚拟主机的情况。

但是由于主机名的 public IP 与平衡器相关联,我不知道应该如何配置私人服务器,以便他们能够知道如何解决要提供的内容。

感谢指导。

使用此答案解决:

Apache does not need to resolve anything regarding DNS.

Just make sure each new virtualhost for the new domains have the appropiate "ServerName" entry reflecting that new domain, this way Apache HTTPD will know where to deliver the request with specified Host.

Link: https://serverfault.com/a/835998/195783