最近有开发者推出 SSL For Free 线上工具,让你从网站上取得免费ssl凭证,当然这是连接Let's Encrypt的凭证签发功能,不过无需自己到主机输入安装指令,即可透过网页界面来取得凭证的相关档案,再从控制台SSL功能将凭证安装进去就能使用。
但是Let's Encrypt 凭证签发为每三个月一次,也就是每90天必须更新一次,不过不用担心,SSL For Free也已提供订阅通知的机制,你可在稍后填入自己的Email,在凭证过期前就会收到电子邮件通知
网站名称:SSL For Free
网站连接:https://www.sslforfree.com/
使用教学
step 1
开启SSL For Free网站后,直接在上方填入你要申请Let's Encrypt 凭证的网站域名,可以用空白来分隔不同的网址,例如「subdomain.domain.com domain.com other.com」,填入后点选右边的「Create Free SSL Certificate」继续
Step2
为了确定这个网站域名是你所有,会有两种验证方式,如果你的网站本身开放FTP功能的话,可使用「Automatic FTPVerification」来输入相关资讯完成验证,因为要将验证分段操作给读者看,所以我选择手动的验证方式,必须自己现在文件,依照说明上传到主机。
点选后,点选下方的「Manually Verify Domain」继续
step3
点选网站上提供的文件下载链接,依照说明建立两层文件夹,将文件放进去即可,记得结束前先透过以下两个链接来看看能否正确读取文件,如果不行,代表你的路径可能错误,重新检查一次吧!总之要让两个链接都能正常开启,再点选最下方「Download SSL Certificate」
Step4
通过验证后 SSL For Free就会开始为你生成ssl凭证
Step5
当凭证产生后,你就能在最终的结果页面看到这些资讯。不过在此之前,我会建议你先找到如下图表示出来的「Get Notified of Expiration」设定一组Email和密码,即可在凭证过期前取得通知,以免错过延长期限
server{
listen 443 default_server;
server_name www.xxxxxxxxx.com;#改成域名
index index.html index.htm index.php;
root /home/wwwroot/default;
ssl on;
ssl_certificate cert/certificate.crt;#https文件目录
ssl_certificate_key cert/private.key;#https文件文件目录
ssl_session_timeout 5m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
ssl_prefer_server_ciphers on;
#error_page 404 /404.html;
# Deny access to PHP files in specific directory
#location ~ /(wp-content|uploads|wp-includes|images)/.*\.php$ { deny all; }
include enable-php.conf;
location /nginx_status
{
stub_status on;
access_log off;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
location ~ /.well-known {
allow all;
}
location ~ /\.
{
deny all;
}
access_log /home/wwwlogs/access.log;
}
80端口转到443,添加一行
rewrite ^/(.*)$ https://www.xxxxxxxxx.com:443/$1 permanent;
————————————————
版权声明:本文为CSDN博主「mason666666」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/mm41254125/article/details/80536268