arr url 重写不适用于外部网站

问题描述 投票:0回答:3

我们正在尝试使用 ARR 和 URL Rewrite 设置反向代理机制。当目标 URL 是托管在同一服务器中的 URL 时,重写工作正常。但是,当我们尝试将其路由到外部服务器时,路由现在正在工作。我们正在得到

HTTP Error 502.3 - Bad Gateway
The operation timed out 

Module ApplicationRequestRouting 
Notification ExecuteRequestHandler 
Handler ApplicationRequestRoutingHandler 
Error Code 0x80072ee2 
Requested URL http://localhost:8882/ff 
Physical Path D:\pocwebsites\exposed\ff 
Logon Method Anonymous 
Logon User Anonymous 


•The CGI application did not return a valid set of HTTP errors.
•A server acting as a proxy or gateway was unable to process the request due to an error in a parent gateway.

•Use DebugDiag to troubleshoot the CGI application.
•Determine if a proxy or gateway is responsible for this error.

请找到下面给出的 web.config 文件,

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
    <rewrite>
        <rules>
        <rule name="or_rule_1" enabled="true">
            <match url=".*" />
            <action type="Rewrite" url="http://www.cnn.com" />
        </rule>
        </rules>
    </rewrite>
    </system.webServer>
</configuration>
url iis url-rewriting arr
3个回答
6
投票

我们也有类似的问题。将 url 重写到本地站点没有问题,但重写到外部站点会出现严重的网关错误。

我们确实有一个内部代理(您也在 IE 中设置的代理来访问外部站点)。在 ARR 反向代理页面中设置相同的代理解决了我们的问题。


3
投票

在 Windows 2008、IIS 7.5 上也有类似问题 问题在于应用程序池处于集成模式。这导致了重写的问题。 重定向总是没问题,但重写总是失败。

我将应用程序池更改为经典模式并解决了问题(至少现在是这样)。

更好的解决方案可能是 http://forums.iis.net/t/1200671.aspx?ARR+URl+Rewrite+is+not+working+for+external+servers 就在最后。但我还没试过。


0
投票

@isMael 对我很有用。使用 AAR 作为反向代理时,需要花费大量时间来调查 PUT 请求失败的问题。更改经典应用程序池是技巧。

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.