1.在域名商下载SSL证书。以阿里云为例,申请免费SSL证书。(下载的apache)
2.上传解压证书。并修改修改/etc/httpd/conf.d/ssl.conf 文件,证书路径。
SSLCertificateFile
SSLCertificateKeyFile
3.修改 /var/www/html/index.html 文件,第一行添加:
<meta http-equiv=“Content-Security-Policy” content=“upgrade-insecure-requests”/>
4.重启httpd
systemctl restart httpd
5.登录域名访问