我正在尝试使用 IIS 7.5 设置反向代理。我希望 Tomcat 提供与某个 URL 模式匹配的传入请求。我已经使用这里的教程来配置它。
我的设置如下:
<rewrite>
<rules>
<rule name="ReverseProxyInboundRule1" stopProcessing="true">
<match url=".*/(Locations|FacetedSearch|LocationPage)/.*" />
<action type="Rewrite" url="http://search.xxx.com/{R:1}" />
<serverVariables>
<set name="HTTP_ACCEPT_ENCODING" value="" replace="true" />
</serverVariables>
</rule>
</rules>
<outboundRules>
<rule name="ReverseProxyOutboundRule1" preCondition="ResponseIsHtml1">
<match filterByTags="A, Form, Img" pattern="^http(s)?://search.xxx.com/(.*)" />
<action type="Rewrite" value="http{R:1}://dev.xxx.com/{R:2}" />
</rule>
<preConditions>
<preCondition name="ResponseIsHtml1">
<add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" />
</preCondition>
</preConditions>
</outboundRules>
</rewrite>
<tracing>
HTTP 错误 500.52 - URL 重写模块错误。当 HTTP 响应的内容被编码(“deflate”)时,不能应用出站重写规则。