我正在嘗試設置IIS 7.5的反向代理。我想要一個匹配特定URL模式的傳入請求由Tomcat提供。我已經在這裏使用這個教程來配置它。HTTP錯誤500.52 - 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」),不能應用出站重寫規則。
什麼是「本」禁用動態和靜態內容壓縮?請你補充一點,請! – Cleb
嗯:)檢查了這一點:http://www.wrapcode.com/infrastructure/configure-reverse-proxy-with-url-rewrite-and-arr-for-iis/ –
它幫助我添加註冊添加HKEY_LOCAL_MACHINE \ SOFTWARE \微軟\ InetStp \快退 儀式/ v LogRewrittenUrlEnabled /噸REG_DWORD/d 0 我測試註冊,你將需要允許服務器變量在以下:HTTP_ACCEPT_ENCODING,HTTP_CUST,HTTP_HOST,HTTP_MAX_FORWARDS,HTTP_X_ORIGINAL_SERVER_POST,HTTPS –