简体   繁体   English

将多个域名解析到同一WAN IP上的不同虚拟机

[英]Resolving multiple domain names to different virtual machines on the same WAN IP

I am running a couple of VMs on my LAN (using proxmox) and I have a single External IP. 我正在LAN上运行几个VM(使用proxmox),并且只有一个外部IP。 I have 2 domains and I have them setup to resolve to my External IP. 我有2个域,并且设置了它们以解析为我的外部IP。

Question: I would like to do the following 问题:我想做以下事情

  1. point www.myfirstdomain.com to come VM1 at port 80 将www.myfirstdomain.com指向端口80上的VM1
  2. point www.mysecondomain.com to VM2 at port 80 将www.mysecondomain.com指向端口80上的VM2

I haven't been able to find a solution to this specific scenario. 我还没有找到针对这种特定情况的解决方案。 Any pointers will be great. 任何指针都会很棒。

You'll need something that understands HTTP, ie something that operates at OSI Layer 7. The only way I know to do that is to have something like an HTTP load balancer in front of your VM's, then have your VM's on some sort of private (eg 192.168.1.0/24) IP space behind that load balancer (LB). 您需要能够理解HTTP的东西,即可以在OSI Layer 7上运行的东西。我知道的唯一方法是在VM的前面安装HTTP负载平衡器之类的东西,然后将VM放在某种私有的设备上。 (例如192.168.1.0/24)该负载平衡器(LB)后面的IP空间。 The LB will then interpret the HTTP URL and direct HTTP sessions to the appropriate VM. 然后,LB将解释HTTP URL,并将HTTP会话定向到适当的VM。

Personally, the way I do it is just run both URL's on a single Apache instance using VirtualHosts. 就个人而言,我的方法是使用VirtualHosts在单个Apache实例上运行两个URL。 It's actually pretty secure to do it that way, and it's the "time honored" way to run multiple Web sites on a single WAN IP address. 这样实际上是相当安全的,并且它是在单个WAN IP地址上运行多个网站的“按时完成”的方式。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 解析与多个域名对应的IP地址 - Resolving IP addresses that correspond to multiple domain names 通过不同的端口将不同的域名分配给同一IP地址 - Different domain names assigned to the same IP address with different ports 我们可以将多个域名指向同一个 IP 地址吗? - Can we point multiple domain names to the same IP address? 在同一个Rails应用程序上是否可以有多个具有不同域名的网站? - Is it possible to have multiple websites, with different domain names, on the same Rails application? 在同一网页上是否可以有多个域名指向不同的URL? - Is it possible to have multiple domain names pointing to different urls on same webpage? 将来自不同主机的多个IP地址指向具有不同端口的同一域名 - Pointing multiple IP address from different hosts to a same domain name with different port 单个静态IP后面的不同机器上的多个Web服务器 - Multiple webservers on different machines behind single static IP apache中具有相同ip和端口的多个域 - Multiple domain with the same ip and port in apache 分配有 IP 的域名 - Domain names assigned with IP 将多个域名指向同一位置 - Pointing multiple domain names at same place
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM