IIS反向代理和URL重写不起作用

我做了以下步骤:

  1. 将所有的needefunction安装到IIS(URLRewrite 2.0,ARR,…)
  2. 在VisualStudio中创build默认的MVC Web应用程序
  3. 添加这个网站应用程序作为iis的新网站(我可以通过http://localhost访问它)
  4. 为这个网站打开了URLRewrite
  5. 点击Add Rule(s)...
  6. selectReverse Proxy
  7. inputgoogle.com作为服务器,HTTP请求将被发送
  8. 未选中Enable SSL Offloading
  9. 点击OK

当我访问http://localhost我仍然拥有自己的webapp,而不是google.com 。 在我的web.config有:

 <rewrite> <rules> <rule name="ReverseProxyInboundRule1" stopProcessing="true"> <match url="(.*)" /> <conditions> <add input="{CACHE_URL}" pattern="^(https?)://" /> </conditions> <action type="Rewrite" url="{C:1}://google.com/{R:1}" /> </rule> </rules> </rewrite> 

然后,我尝试添加更有用的规则:将localhost/google/sth重写google.com/search?q=sth 。 我改变了web.config

 <rewrite> <rules> <rule name="ReverseProxyInboundRule1" stopProcessing="true"> <match url="^google/(.*)" /> <conditions> <add input="{CACHE_URL}" pattern="^(https?)://" /> </conditions> <action type="Rewrite" url="{C:1}://google.com/search?q={R:1}" /> </rule> </rules> </rewrite> 

而且它仍然不起作用。