我做了以下步骤:
http://localhost访问它) Add Rule(s)... Reverse Proxy google.com作为服务器,HTTP请求将被发送 Enable SSL Offloading 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>
而且它仍然不起作用。