2017-04-18 33 views
0

目前,我有一个IIS 8.5服务器的URL:在IIS 8.5中,如何将子域映射到站点内的应用程序?

subdomain.domain.com/application_instance_name_1

下一个称为Portal申请网站有应用程序的3个实例,一个为每一个客户。

我想创建每个客户一个子域并将其引导到他们的版本称为Portal应用程序的网站下的应用,例如,客户1人键入:

customer_1_name.domain.com

和IIS将被引导到网站和应用程序如下:

网站/门户网站应用程序/ customer_1_application

这是我第一次张贴在这里,我没有发现的东西MAYB e相关here但它的Apache不是IIS。

如果您需要更多信息,请让我知道。

感谢

布赖恩

回答

0

1)您需要安装URL RewriteARR module为IIS

2)启用ARR。在Application Request Routing页面上,选择Enable proxy

3)创建重写规则

<rewrite> 
     <rules> 
      <rule name="rewrite customer_1_name.domain.com" stopProcessing="true"> 
       <match url="(.*)" /> 
       <conditions logicalGrouping="MatchAll"> 
        <add input="{HTTP_HOST}" pattern="^customer_1_name.domain.com$" ignoreCase="true" /> 
       </conditions> 
       <action type="Rewrite" url="http://subdomain.domain.com/Portal Application/customer_1_application/{R:1}" /> 
      </rule> 
     </rules> 
    </rewrite> 

附:你的资源可能有问题(图片,样式,CSS,JS)。因为您的html可能包含资源的绝对路径

您可以在作者创建用于修复相关URL的出站规则时检查此帖子https://blogs.iis.net/carlosag/setting-up-a-reverse-proxy-using-iis-url-rewrite-and-arr

相关问题