简体   繁体   English

IIS重写规则以重写到其他网站

[英]IIS Rewrite rule to rewrite to different web site

I have 2 web sites installed on the same IIS server. 我在同一IIS服务器上安装了2个网站。 I need them both to listen on port 443 with HTTPS. 我需要它们都使用HTTPS在端口443上侦听。 I want them to use different application pools and be able to stop and start one without affecting the other. 我希望他们使用不同的应用程序池,并能够停止和启动一个而不影响另一个。 The clients of these websites are not able to configure the host header that they use in their HTTP requests. 这些网站的客户端无法配置其HTTP请求中使用的主机标头。

Is there a solution? 有解决方案吗? I have been trying to use IIS Rewrite rules. 我一直在尝试使用IIS重写规则。 I have one website deployed on port 443 and the other on some unusual port. 我在一个端口443上部署了一个网站,在另一个不寻常的端口上部署了另一个网站。 I tried setting up a URL rewrite on the first one that did a rewrite (not a redirect) to an absolute URL referencing the 2nd site on the unusual port. 我尝试在第一个URL上设置URL重写,该URL重写了(而不是重定向)到引用异常端口上第二个站点的绝对URL。 This always seems to produce an HTTP 404 response. 这似乎总是产生HTTP 404响应。

I can't do a redirect because the client gets redirected to the unusual port and the client is not allowed to make internet requests to non-standard ports. 我无法进行重定向,因为客户端被重定向到异常端口,并且不允许客户端向非标准端口发出Internet请求。

I believe I am using IIS 6.2, that's what is says in the Help about in IIS MAnager 我相信我正在使用IIS 6.2,这就是IIS MAnager中“关于帮助”的内容

What options do I have? 我有什么选择?

It is not possible to rewrite to different applications in IIS, especially if they are in different application pools. 无法重写到IIS中的不同应用程序,尤其是当它们位于不同的应用程序池中时。 Your only option is redirect if you want to do it simply using URL Rewrite. 如果您只想使用URL Rewrite,则唯一的选择是重定向。 Another alternative is to use ARR (Application Request Routing) and then proxy the call to the actual site depending on rules, this has also the advantage that sites could be in different machines or in the same one, and give you more flexibility. 另一种选择是使用ARR(应用程序请求路由),然后根据规则将呼叫代理到实际站点,这还有一个优点,即站点可以位于不同的计算机或同一台计算机上,并为您提供更大的灵活性。 Obviously it does come with more complexity. 显然,它确实带来了更多的复杂性。

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

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