域名SSL证书安装记录(Nginx)
Tomcat和Nginx使用证书的方法不一样
1.在腾讯云控制台申请证书
需要按照流程,加上一条CNAME记录
2.将证书拷贝到Nginx所在的服务器上
例如:
/usr/local/webserver/nginx/sslcertificate/followmentor.com_nginx
3.配置nginx.conf
找域名对应443端口设置,加上证书地址ssl_certificate和证书密钥地址ssl_certificate_key:
server {
listen 443 ssl;
server_name followmentor.com;
ssl_certificate /usr/local/webserver/nginx/sslcertificate/followmentor.com_nginx/followmentor.com_bundle.crt;
ssl_certificate_key /usr/local/webserver/nginx/sslcertificate/followmentor.com_nginx/followmentor.com.key;
location / {
proxy_pass https://followmentor.com;
index index.html index.htm;
}
}
4.验证并重启nginx服务测试
nginx -t
重启Nginx服务:
nginx -s reload
或者
[root@localhost ~]# systemctl restart nginx
然后在浏览器上,输入:https://域名 查看是否证书正确显示。
原文地址:https://blog.csdn.net/weixin_42844704/article/details/140583663
免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!