Web.Config 重定向到维护页面?

Web.Config redirect to maintenance page?

https://gist.github.com/stevensk/c8108311b82ba1591cb1be018bbe0119 开始,我已将以下代码添加到我们的 web.config 以用于“站点维护页面重定向”。

对于不是我的 IP(我的在 IP 列表中的第 3 项),用户被定向到站点维护页面,但它没有显示背景图像、指定字体或其他CSS 文件样式。

Firefox 检查器以红色显示以下消息:

The resource from
“https://www.example.com/pages/maintenance/message/default.htm”
was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).

如何让维护页面应用正确的字体、图像和其他样式?

<rewrite>

            <!-- Maintenance rewrite map
             - Add allowed IP addresses to grant access during maintenance period
             - To activate, uncomment Maintenance Redirect rule
             - And replace last key with current IP found at /pages/test/remote-name/
             -->
            
            <rewriteMaps>
                <rewriteMap name="MaintenanceIpAddressWhitelist" defaultValue="">                   
                    <add key="192.168.0.1" value="1" />
                    <add key="127.0.0.1" value="1" />
                    <add key="198.43.70.125" value="1"/>
                </rewriteMap>
            </rewriteMaps>          
            
            <rules>             
                
                <rule name="HTTP/S to HTTPS Redirect" enabled="true" stopProcessing="true">
                    <match url="(.*)" />
                    <conditions logicalGrouping="MatchAny">
                        <add input="{SERVER_PORT_SECURE}" pattern="^0$" />
                    </conditions>
                    <action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" redirectType="Permanent" />
                </rule>

                <rule name="ensurewww" stopProcessing="true">
                    <match url=".*" />
                    <conditions>
                        <add input="{CACHE_URL}" pattern="^(.+)://(?!www)(.*)" />
                    </conditions>
                    <action type="Redirect" url="{C:1}://www.{C:2}" redirectType="Permanent" />
                </rule>

                <!-- Maintenance Rule -->
                <rule name="Maintenance Redirect">
                    <match url=".*" />
                    <conditions logicalGrouping="MatchAll">
                        <add input="{MaintenanceIpAddressWhitelist:{REMOTE_ADDR}}" matchType="Pattern" pattern="1" negate="true" />
                        <add input="{REQUEST_URI}" pattern="^/pages/maintenance/message/default.htm$" negate="true" />
                    </conditions>
                    <action type="Redirect" url="/pages/maintenance/message/default.htm" appendQueryString="false" redirectType="Temporary"/>
                </rule>

            </rules>

        </rewrite>

我最终将图像、css、svg 和字体文件作为 base64 嵌入到 default.htm 页面中。