那么如何在myssl.com拿到A+评分呢?
首先你应该去你的网站配置文件(也就是Nginx配置文件)加如下代码
add_header Strict-Transport-Security "max-age=63072000; includeSubdomains; preload";
如果你是用的宝塔面板(Bt.cn),只需要参照上图添加代码即可。
将以下代码添加到网站根目录 index.php 中或者header.php中
header("Strict-Transport-Security: max-age=63072000; includeSubdomains; preload");
这段代码加上之后,所有非https的资源都会以https形式加载,但是要确保此外链支持https访问正常。
原创文章,作者:陌涛,如若转载,请注明出处:https://imotao.com/179.html