IIS 7 重写子域以指向特定端口

Tom*_*sen 5 iis rewrite iis-7

在 Windows Server 2008 上安装了 Team Foundation Server 2010 后,我需要一个简单的 URL 供我们的开发人员访问他们的存储库。

TFS 存储库的默认 URL 是http://localhost:8080/tfs

现在我希望子域域 tfs.server.domain.com 指向http://localhost:8080/tfs。当您访问 tfs.server.domain.com/repos_name 时,它​​应该重定向到http://localhost:8080/tfs/repos_name

我怎样才能在 IIS7 中做到这一点?

我已经尝试使用以下规则,但它不起作用。我得到一个 404。

<rewrite>
 <globalRules>
  <rule name="TFS" stopProcessing="true">
   <match url="^(?:tfs/)?(.*)" />
   <conditions>
    <add input="{HTTP_HOST}" pattern="^tfs.server.domain.com$" />
   </conditions>
   <action type="Rewrite" url="http://localhost:8080/tfs/{R:1}" />
  </rule>
 </globalRules>
</rewrite>
Run Code Online (Sandbox Code Playgroud)

编辑

我实际上是通过在端口 80 上使用主机名 tfs.server.domain.com 为站点添加绑定来实现的。

但是使用 tfs.server.domain.com,我无法使用 Windows 身份验证进行身份验证。是否需要为 Windows 身份验证配置某些内容?

你可以在这里看到一个痕迹:http : //pastebin.com/k0QrnL0m

Gab*_*ran 0

您是否尝试过在 Team Foundation Server 管理控制台中更改它?您还可以使用以下命令更改 URL:

C:\Program Files\Microsoft Team Foundation Server 2010\Tools>tfsconfig 设置/notificationUrl:http://tfs.nimble.org/tfs

例如,我们的 TFS 2010 安装在虚拟机上,基础设施人员遵循他们的命名约定,该机器被命名为 BEL-VM-TFS。但现在每个人都通过 tfs.nimble.org 连接到它。

除此之外,我们还必须在 DNS 服务器上添加一个别名“TFS”,指向服务器“BEL-VM-TFS”。