简体   繁体   English

IIS 7 IP地址转发

[英]IIS 7 IP address forwarding

I want to move some websites from server 1 to server 2. 我想将某些网站从服务器1移到服务器2。

My clients have A records pointing to the IP address of server 1. Without updating their DNS records, how can I automatically forward request for those domains from server 1 to server 2? 我的客户端具有指向服务器1的IP地址的A记录。在不更新其DNS记录的情况下,如何自动将对这些域的请求从服务器1转发到服务器2?

Thanks 谢谢

Graham 格雷厄姆

This image is from an article regarding Exchange , but the IIS settings are relevant. 此图像来自有关Exchange的文章 ,但IIS设置是相关的。

You can redirect at the HTTP level by specifying a URL redirect in IIS's HTTP Redirect settings:- 您可以通过在IIS的HTTP重定向设置中指定URL重定向来在HTTP级别进行重定向

IIS中的HTTP重定向

However, for this approach to work you will need a new domain for your sites. 但是,要使这种方法起作用,您将需要为您的站点使用一个新域。 eg if the A record resolves www.example.com to Server 1 you will need to redirect to another URL (eg www.example.edu ) that already resolves to Server 2 . 例如,如果A记录将www.example.com解析为Server 1您将需要重定向到已经解析为Server 2另一个URL(例如www.example.edu )。

Another option is to setup a reverse proxy using IIS on Server 1 : 另一种选择是在Server 1上使用IIS 设置反向代理

Today there was a question in the IIS.net Forums asking how to expose two different Internet sites from another site making them look like if they were subdirectories in the main site. 今天在IIS.net论坛中有一个问题,询问如何从另一个站点公开两个不同的Internet站点,使它们看起来像它们是主站点中的子目录。

So for example the goal was to have a site: www.site.com expose a www.site.com/company1 and a www.site.com/company2 and have the content from www.company1.com served for the first one and www.company2.com served in the second one 因此,例如,目标是要拥有一个网站: www.site.com公开一个www.site.com/company1www.site.com/company2并将www.company1.com的内容提供给第一个网站, www.company2.com位于第二个

So slightly different requirements (the article only wants a subdirectory rather than the whole site), but the same concept will apply. 因此要求略有不同(本文只需要一个子目录,而不是整个站点),但是将应用相同的概念。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM