用于 https 重定向的 URL 重写不适用于 iis10 上的端口 8443

问题描述

我在 IIS10 上托管了一个应用程序,端口为 8443。我编写了 URL 重写规则来将 http 请求重定向到 https。下面是xml文件的一部分。 它不适用于端口 8443 但如果我将端口更改为 443,它就会开始工作。

 <rewrite>
            <rules>
                <rule name="HTTPS Redirection" stopProcessing="true">
                    <match url="(.*)" />
                    <conditions trackAllCaptures="false">
                        <add input="{HTTPS}" pattern="^OFF$" />
                    </conditions>
                    <action type="Redirect" url="https://{HTTP_HOST}:8443/{R:1}" appendQueryString="false" redirectType="Permanent" />
                </rule>
            </rules>
        </rewrite> 

提前致谢!

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)