您好,欢迎访问一九零五行业门户网

Linux+Nginx下SSL证书安装

一.nginx安装ssl证书需要两个配置文件
1_root_bundle.crt、 2_domainname.com.key。
注:这三个证书文件都在文件夹for nginx.zip中,例:1_root_bundle.crt是根证书链(公钥),2_ domainname.com.key为私钥。
(其中:证书公钥、私钥文件一般以您的域名命名;证书后缀名crt和cer的性质是一样的)。
二.nginx安装证书
1.打开nginx安装目录下conf目录中的nginx.conf文件 
找到:
  # https server 
   # 
   #server { 
   #    listen       443; 
   #    server_name  localhost; 
   #    ssl            on; 
   #    ssl_certificate      cert.pem; 
   #    ssl_certificate_key  cert.key; 
   #    ssl_session_timeout  5m; 
   #    ssl_protocols  sslv2 sslv3 tlsv1; 
   #    ssl_ciphers  all:!adh:!export56:rc4+rsa:+high:+medium:+low:+sslv2:+exp; 
   #    ssl_prefer_server_ciphers   on; 
   #    location / { 
   #        root   html; 
   #        index  index.html index.htm; 
   #    } 
   #} 
将其修改为 :
      server { 
       listen       443; 
       server_name  localhost; 
       ssl                  on; 
       ssl_certificate      1_root_bundle.crt;      (证书公钥)
       ssl_certificate_key      2_ domainname.com.key;      (证书私钥)
       ssl_session_timeout  5m; 
       ssl_protocols  sslv3 tlsv1; 
       ssl_ciphers  high:!adh:!export56:rc4+rsa:+medium; 
       ssl_prefer_server_ciphers   on; 
       location / { 
           root   html; 
           index  index.html index.htm; 
       } 
   }
注:配置完成后的网站路径及默认页等配置请与80端口保持一致。
2.启动nginx,访问https://+证书绑定的域名
注:部署完毕后若网站无法通过https正常访问,可确认服务器443端口是否开启或被网站卫士等加速工具拦截。
(1)开启方法:防火墙设置-例外端口-添加443端口(tcp)。
(2)若被安全或加速工具拦截,可以在拦截记录中将443添加至信任列表。
重启后,重新通过https访问。
具体请查看链接:http://www.zzidc.com/main/help/showhelpcontent/id_460.html
以上就介绍了linux+nginx下ssl证书安装,包括了方面的内容,希望对php教程有兴趣的朋友有所帮助。
其它类似信息

推荐信息