Asp.net IIS上的反向代理

Asp.net IIS上的反向代理,asp.net,iis-7.5,Asp.net,Iis 7.5,我有一个asp.net网站托管在iis 7.5上。我正在尝试将iis重写器模块用于反向代理。我在web.config文件中实现了以下代码。该代码适用于1个网站news.mysite.co.uk,但不适用于blog.mysite.co.uk。看起来我没有正确地执行outbond规则 这是最后的工作代码 <rewrite> <rules> <rule name="ReverseProxyInboundRule1" stopProcessing="true">

我有一个asp.net网站托管在iis 7.5上。我正在尝试将iis重写器模块用于反向代理。我在web.config文件中实现了以下代码。该代码适用于1个网站news.mysite.co.uk,但不适用于blog.mysite.co.uk。看起来我没有正确地执行outbond规则


这是最后的工作代码

<rewrite>
<rules>
  <rule name="ReverseProxyInboundRule1" stopProcessing="true">
    <match url="^news/(.*)" />
    <action type="Rewrite" url="http://news.mysite.co.uk/{R:1}" />
    <serverVariables>
      <set name="HTTP_ACCEPT_ENCODING" value="" />
    </serverVariables>
  </rule>
  <rule name="ReverseProxyInboundRule2" stopProcessing="true">
    <match url="^blog/(.*)" />
    <action type="Rewrite" url="http://blog.mysite.co.uk/{R:1}" />
    <serverVariables>
      <set name="HTTP_ACCEPT_ENCODING" value="" />
    </serverVariables>
  </rule>
</rules>
<outboundRules>
  <rule name="ReverseProxyOutboundRule1" preCondition="ResponseIsHtml2">
    <match filterByTags="A, Img" pattern="^/(.*)" />
    <conditions>
      <add input="{URL}" pattern="^/(news|blog)/.*" />
    </conditions>
    <action type="Rewrite" value="/{C:1}/{R:1}" />
  </rule>
  <rule name="ReverseProxyOutboundRule2" preCondition="ResponseIsHtml2">
    <match filterByTags="A, Form, Img" pattern="^http(s)?://news.mysite.co.uk/(.*)" />
    <action type="Rewrite" value="/news/{R:2}" />
  </rule>
  <rule name="ReverseProxyOutboundRule4" preCondition="ResponseIsHtml2">
    <match filterByTags="A, Form, Img" pattern="^http(s)?://blog.mysite.co.uk/(.*)" />
    <action type="Rewrite" value="/blog/{R:2}" />
  </rule>
  <preConditions>
    <preCondition name="ResponseIsHtml2">
      <add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" />
    </preCondition>
  </preConditions>
</outboundRules>
</rewrite>

这有那么难吗?
<rewrite>
<rules>
  <rule name="ReverseProxyInboundRule1" stopProcessing="true">
    <match url="^news/(.*)" />
    <action type="Rewrite" url="http://news.mysite.co.uk/{R:1}" />
    <serverVariables>
      <set name="HTTP_ACCEPT_ENCODING" value="" />
    </serverVariables>
  </rule>
  <rule name="ReverseProxyInboundRule2" stopProcessing="true">
    <match url="^blog/(.*)" />
    <action type="Rewrite" url="http://blog.mysite.co.uk/{R:1}" />
    <serverVariables>
      <set name="HTTP_ACCEPT_ENCODING" value="" />
    </serverVariables>
  </rule>
</rules>
<outboundRules>
  <rule name="ReverseProxyOutboundRule1" preCondition="ResponseIsHtml2">
    <match filterByTags="A, Img" pattern="^/(.*)" />
    <conditions>
      <add input="{URL}" pattern="^/(news|blog)/.*" />
    </conditions>
    <action type="Rewrite" value="/{C:1}/{R:1}" />
  </rule>
  <rule name="ReverseProxyOutboundRule2" preCondition="ResponseIsHtml2">
    <match filterByTags="A, Form, Img" pattern="^http(s)?://news.mysite.co.uk/(.*)" />
    <action type="Rewrite" value="/news/{R:2}" />
  </rule>
  <rule name="ReverseProxyOutboundRule4" preCondition="ResponseIsHtml2">
    <match filterByTags="A, Form, Img" pattern="^http(s)?://blog.mysite.co.uk/(.*)" />
    <action type="Rewrite" value="/blog/{R:2}" />
  </rule>
  <preConditions>
    <preCondition name="ResponseIsHtml2">
      <add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" />
    </preCondition>
  </preConditions>
</outboundRules>
</rewrite>