如何应用Application Request Routing在IIS7配置反向代理
首先前往http://www.iis.net/extensions/ApplicationRequestRouting下载Application Request Routing,然后安装
安装完后在IIS管理界面找到ARR配置菜单:Application Request Routing
点击右测开启Proxy项:server proxy settings..
打开配置界面 在Enable proxy前面打勾保存
在站点下建立web.config保存代码
iis7全站反向代理设置
<?xml version=”1.0″ encoding=”UTF-8″?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name=”fxdl” stopProcessing=”true”>
<match url=”^(.*)” />
<conditions>
<add input=”{HTTP_HOST}” pattern=”(.*)” ignoreCase=”false” />
</conditions>
<action type=”Rewrite” url=”http://要反向代理的网站ip/{R:1}” />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
iis7二级目录反向代理设置
<?xml version=”1.0″ encoding=”UTF-8″?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name=”fxdl” stopProcessing=”true”>
<match url=”^abc(.*)” />
<conditions>
<add input=”{HTTP_HOST}” pattern=”(.*)” ignoreCase=”false” />
</conditions>
<action type=”Rewrite” url=”http://要反向代理的网站ip/{R:1}” />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>