简体   繁体   English

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

[英]arr url rewrite not working for external sites

We are trying to setup a reverse proxy mechanism using ARR and URL Rewrite. 我们正在尝试使用ARR和URL Rewrite设置反向代理机制。 The rewriting is working fine when the target url is a one which is hosted in the same server. 当目标URL是托管在同一服务器中的URL时,重写工作正常。 But when we try to route it to an external server the routing is now working. 但是当我们尝试将其路由到外部服务器时,路由正在运行。 We are getting the 我们正在接受

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.

Please find the web.config file given below, 请找到下面给出的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>

We had a similar issue. 我们遇到了类似的问题。 Rewriting the url to a local site was no problem, but rewriting to an external site gave a bad gateway error. 将URL重写到本地站点没有问题,但重写到外部站点会导致错误的网关错误。

We do have an internal proxy (the proxy you also set in IE to visit external sites). 我们有一个内部代理(您也在IE中设置的代理访问外部网站)。 Setting this same proxy in the ARR reverse proxy page fixed our issue. 在ARR反向代理页面中设置此相同代理解决了我们的问题。

Had a similar issue on Windows 2008, IIS 7.5 The problem was that the app pool was in integrated mode. 在Windows 2008上有类似的问题,IIS 7.5问题是应用程序池处于集成模式。 that caused issues with the rewrite. 这导致了重写的问题。 Redirect was always ok, but rewrite always failed. 重定向始终没问题,但重写始终失败。

i changed the app pool to classic mode and problem solved (at least for now). 我将应用程序池更改为经典模式并解决了问题(至少目前为止)。

a better solution might be http://forums.iis.net/t/1200671.aspx?ARR+URl+Rewrite+is+not+working+for+external+servers right at the end. 一个更好的解决方案可能是http://forums.iis.net/t/1200671.aspx?ARR+URl+Rewrite+is+not+working+for+external+servers最后。 but i havent tried it. 但我还没试过。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM