小编Hoc*_*eyJ的帖子

IIS 反向代理不使用 ASP.NET 中的 Response.Redirect()

我正在尝试使用此处此处此处的教程设置反向代理。

该站点设置在localhost:8080,反向代理使用localhost:8080/myProxy.

处理标准链接时,一切都很好。我可以查看代理 url 并按预期查看所有内容。从链接localhost:8080/myProxy/default.aspx进入localhost:8080/myProxy/about.aspx预期。

我遇到的问题是,在使用 .NET 的地方Response.Redirect(),url 更改为网站的实际位置,而不是代理。

即链接来自localhost:8080/myproxy/default.aspx-> localhost:8080/about.aspx

请问我该如何解决?

这是我的配置:

<system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
    <urlCompression doStaticCompression="false" doDynamicCompression="false" 
                    dynamicCompressionBeforeCache="false" />
    <rewrite>
        <rules>
            <rule name="Reverse Proxy to my site" stopProcessing="true">
                <match url="^myProxy/(.*)" />
                <action type="Rewrite" url="http://localhost:8080/{R:1}" />
            </rule>
        </rules>

        <outboundRules>
            <rule name="ReverseProxyOutboundRule1" preCondition="ResponseIsHtml1">
                <match filterByTags="A, Area, Base, Form, Frame, Head, IFrame, Img, Input, Link, Script"
                       pattern="^http(s)?://localhost:8080/(.*)" />
                <action type="Rewrite" value="/myProxy/{R:2}" /> …
Run Code Online (Sandbox Code Playgroud)

iis rewrite asp.net reverse-proxy iis-7.5

3
推荐指数
1
解决办法
6461
查看次数

标签 统计

asp.net ×1

iis ×1

iis-7.5 ×1

reverse-proxy ×1

rewrite ×1