IIS webconfig http重定向https配置

发布时间 2023-03-30 10:18:43作者: 榕树下的回忆
                <rule name="redirect to HTTPS" stopProcessing="true">
                    <match url="(.*)" />
                    <conditions>
                        <add input="{HTTP_HOST}" pattern="localhost" negate="true" />
                        <add input="{HTTP_HOST}" pattern="127.0.0.1" negate="true" />
                        <add input="{HTTPS}" pattern="^OFF$" />
                    </conditions>
                    <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" />
                </rule>