在 IIS 中增加相关安全 HTTP 头信息配置

<?xml version="1.0" encoding="UTF-8"?> <configuration>     <system.webServer>         <!-- 增加为了安全的 HTTP 头信息 -->         <httpProtocol>...

<?xml version="1.0" encoding="UTF-8"?>

<configuration>

    <system.webServer>

        <!-- 增加为了安全的 HTTP 头信息 -->

        <httpProtocol>

            <customHeaders>

                <remove name="X-Powered-By" />

                <add name="Content-Security-Policy" value="frame-ancestors 'self'; default-src 'self' 'unsafe-inline' 'unsafe-eval' blob: data:" />

                <add name="X-Frame-Options" value="SAMEORIGIN" />

                <add name="X-XSS-Protection" value="1" />

                <add name="X-Content-Type-Options" value="nosniff" />

                <add name="X-Permitted-Cross-Domain-Policies" value="master-only" />

                <add name="X-Download-Options" value="noopen" />

                <add name="Referrer-Policy" value="origin-when-cross-origin" />

            </customHeaders>

        </httpProtocol>

    </system.webServer>

</configuration>

  • 发表于 2023-04-19 14:36
  • 阅读 ( 1658 )
  • 分类:服务器

0 条评论

请先 登录 后评论
东北大表哥
东北大表哥

自由职业

161 篇文章

作家榜 »

  1. 东北大表哥 161 文章
  2. 小鹄 1 文章
  3. 阿天 0 文章
  4. 新百胜在线 0 文章
  5. 刘明明 0 文章
  6. 个的德3 0 文章
  7. 铂天先生 0 文章
  8. 王达 0 文章