远程协助
当前位置:重庆拓磊计算机运营维护中心 > 文档中心 > 服务器 >
标题:nginx配置免费的ssl证书,支持https安全访问    日期:2018-08-04

免费ssl证书申请

到 http://www.wosign.com/Products/free_SSL.htm 申请免费的SSL证书。

下载www.iamle.com.zip文件,解压文件,找到for Nginx.zip解压,得到2个文件

1_www.iamle.com_bundle.crt ,2_www.iamle.com.key

改个名字www.iamle.com.crt,www.iamle.com.key传到服务器上备用

Nginx配置SSL证书部署https支持

找到对应的server

增加

listen          443 ssl;
ssl                     on;
ssl_certificate         /usr/local/nginx/conf/ssl/www.iamle.com.crt;
ssl_certificate_key     /usr/local/nginx/conf/ssl/www.iamle.com.key;
ssl_session_timeout     5m;
ssl_protocols           TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers             ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
ssl_prefer_server_ciphers       on;
 

重新载入nginx配置

[root@do ssl]# /etc/init.d/nginx  reload

浏览器信任的https://www.iamle.com 已经可用了~

 
补充

转换pfx为nginx需要的crt,重庆网络维护,key

如果已经有一个扩展名为pfx的证书,那么需要转换使用

[root@do ~]# openssl pkcs12 -in www.iamle.com.pfx -nocerts -nodes -out www.iamle.com.key
Enter Import Password: 输入证书密码
MAC verified OK

 
[root@do ~]# openssl pkcs12 -in www.iamle.com.pfx -clcerts -nokeys -out www.iamle.com.crt
Enter Import Password: 输入证书密码
MAC verified OK
 
生成2个文件 www.iamle.com.key , www.iamle.com.pfx 复制到你指定的目录

下一篇:建议收藏:好用的 Unix/Linux 命令技巧

联系我们
  • 客服热线:023-63522929(7 x 24h)
  • 在线客服:
  • 微信公众号 官方微博