[英]IIS URL Rewrite domain to one of several VMs
I have a server running several Virtual Machines. 我有一台运行多个虚拟机的服务器。 Each VM runs IIS 8.0 and hosts a variety of different sites.
每个VM运行IIS 8.0,并承载各种不同的站点。 The base server is also running IIS 8.0 and I'm intending that it directs requests to one of of the VMs depending on the HTTP_HOST.
基本服务器也正在运行IIS 8.0,我打算根据HTTP_HOST将请求定向到其中一个VM。
I'm trying to define the inbound and outbound rules to achieve the following: 我正在尝试定义入站和出站规则以实现以下目的:
www.mydomain1.com requests are directed to VM 192.168.1.10/mydomain1
www.mydomain2.com requests are directed to VM 192.168.1.10/mydomain2
www.mydomain3.com requests are directed to VM 192.168.1.11/mydomain3
www.mydomain4.com requests are directed to VM 192.168.1.11/mydomain4
What I want is for the user to see www.mydomainx.com all the time while the internal VM serves up the pages seamlessly without changing the URL. 我想要的是让用户始终看到www.mydomainx.com,而内部VM无缝地为页面提供服务而无需更改URL。 I've spent hours trying every combination I can think of and read dozens of posts but none seem to cover this particular scenario.
我已经花了数小时尝试我能想到的每种组合,并阅读了数十篇文章,但似乎没有一篇涵盖这种特殊情况。
I've got subdomain to folder working (mysub.mydomain.com -> 192.168.1.10/mysub but not full domain name. 我已经将子域设置为可工作的文件夹(mysub.mydomain.com-> 192.168.1.10/mysub,但没有完整的域名。
Any suggestions gratefully received. 任何建议表示感谢。
After a lot of searching and testing I've finally found the solution. 经过大量搜索和测试,我终于找到了解决方案。 Instructions below relate to IIS 8.5.
以下说明与IIS 8.5有关。
For each VM create rules for all the domains being handled. 为每个VM创建要处理的所有域的规则。
Now all you need to do is set up your router to port forward requests on port 80 to your base IIS server and it will then route traffic based on the domain names to the appropriate Virtual Machine. 现在,您所需要做的就是设置路由器,以将端口80上的转发请求移植到基本IIS服务器,然后它将根据域名将流量路由到适当的虚拟机。
I have four Virtual Machines set up this way the routing is seamless and works really well. 我用这种方式设置了四个虚拟机,路由是无缝的,并且运行得很好。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.