常见网站安全漏洞处理方法

attachments-2023-09-tkcYYztU650169279b843.png


如果使用nginx

nginx.conf 文件中设置 http{ } 或 server{ }

add_header Set-Cookie "HttpOnly";

add_header Set-Cookie "Secure";



<rewrite> 

    <outboundRules> 

        <rule name="Add HttpOnly"> 

            <match serverVariable="RESPONSE_Set_Cookie" pattern=".*" /> 

            <conditions> 

                <add input="{R:0}" pattern="; HttpOnly" negate="true" /> 

            </conditions> 

            <action type="Rewrite" value="{R:0}; HttpOnly" /> 

        </rule> 

        <rule name="Add Secure"> 

            <match serverVariable="RESPONSE_Set_Cookie" pattern=".*" /> 

            <conditions> 

                <add input="{R:0}" pattern="; Secure" negate="true" /> 

            </conditions> 

            <action type="Rewrite" value="{R:0}; Secure" /> 

        </rule> 

    </outboundRules> 

</rewrite>


  • 发表于 2023-09-13 15:48
  • 阅读 ( 753 )

你可能感兴趣的文章

相关问题

0 条评论

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

自由职业

173 篇文章

作家榜 »

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