情况是我有2个后端应用程序,我需要为它们设置HTTPS访问权限 . 我在服务器上安装了带有ARR和URL重写模块的IIS 8 . 比我安装2个https证书并创建一个空的网站,在443端口绑定第二个应用程序https证书 . 第一个应用程序设置在8081端口上,第二个应用程序设置在端口80上 . 问题是我只能通过https访问第一个应用程序,第二个应用程序只能通过http访问 . 所以我想设置反向代理,所以我可以通过https访问第二个应用程序 . 我在URL重写中编写了2个入站规则,但是当我尝试访问第二个应用程序时,我遇到了问题,它指向的不是localhost:80,而是指向localhost:8081 . 任何建议为什么会发生?

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <clear />
                <rule name="App2" stopProcessing="true">
                    <match url="^app2/(.*)" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Rewrite" url="http://localhost:80/{R:1}" />
                </rule>
                <rule name="Redirection" stopProcessing="true">
                    <match url="^app2/(.*)" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
                        <add input="{SERVER_PORT}" pattern="443" />
                    </conditions>
                    <action type="Redirect" url="https://app2/{R:0}" />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>