iis配置反向代理
2022/11/09
第一步安装ARR
方式一:
下载地址:https://www.iis.net/downloads/microsoft/application-request-routing
注:装ARR_V3.0 Beta版本,因为应用路由(ARR)3.0新增了对WebSocket协议的支持.
方式二:

在web平台安装程序里搜索“应用程序请求路由”,选择3.0或者更高版本;
第二步
安装urlRewrite

第三步:
配置Application Request Routing Cache


具体配置:

http://localhost:50862即是代理服务器
第四步
配置urlRewrite
iis新建一个空网站,点空网站后再右边主界面双击 "URL重写"

此界面右键选择“添加规则”,在选择“反向代理”,在弹出的界面填写下面信息

(test123是新配的域名)
在URL 重写界面 右上角 点击“查看服务器变量”,然后添加两个变量“HTTP_X_ORIGINAL_ACCEPT_ENCODING”“和”HTTP_ACCEPT_ENCODING“
=====================================
不出意外上面的配置是失败的,需要将新建网站下的webconfig文件如下格式
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<outboundRules>
<rule name="ReverseProxyOutboundRule1" preCondition="ResponseIsHtml1">
<match filterByTags="A, Form, Img" pattern="^http(s)?://test123/(.*)" />
<action type="Rewrite" value="http{R:1}://localhost/{R:2}" />
</rule>
<preConditions>
<preCondition name="ResponseIsHtml1">
<add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" />
</preCondition>
</preConditions>
</outboundRules>
<rules>
<rule name="ReverseProxyInboundRule1" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{CACHE_URL}" pattern="^(https?)://" />
</conditions>
<serverVariables>
<set name="HTTP_X_ORIGINAL_ACCEPT_ENCODING" value="{HTTP_ACCEPT_ENCODING}"/>
<set name="HTTP_ACCEPT_ENCODING" value=""/>
</serverVariables>
<action type="Rewrite" url="{C:1}://test123/{R:1}" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>相关文章
http://t.zoukankan.com/nonkicat-p-10672787.html
https://www.williamlong.info/archives/5353.html
https://www.javaroad.cn/questions/9032
静水缘首页
文章分类
最新文章
- nodejs私钥加密公钥解密的一个例子
- uniapp和微信小程序判断程序运行在开发或者测试或者线上版本的方法分别是什么
- electron使用electron-builder打包后模块包含exe文件执行失败
- Compile is disallowed on the main thread, if the buffer size is larger than 4KB
- better-sqlite3简介及常用操作
- nodejs 操作数据库的库
- nodejs使用http-proxy库实现多个域名代理和同时代理websocket的例子,代理包含https和http两种协议
- iis配置反向代理
- javascript伪多线程代码
- ip所在地址段判断