nginx配置多个ssl证书

2017年1月,苹果公司将强制执行ATS协议,所有文件请求都要通过https协议传输.

公司图片服务是不支持https请求的,为了苹果客户端的流量,必须升级

经过一天的努力,解决问题,记录一下大概的解决步骤:

1.先在网上了解了下https,CA,SSL的一些基本概念

2.有了大概方向后接着查具体在nginx上怎么操作

   主要参考

    http://blog.csdn.net/sand_ant/article/details/10507447

    http://blog.chinaunix.net/uid-20639775-id-3213595.html

3.nginx -V 查看ngxin是否支持TLS SNI协议,

   TLS SNI support enabled,比较幸运,显示enabled

4.为每一个域名配置一个server

server{

    listen 443;

    ssl on;

    ssl_certificate /etc/nginx/conf.d/ssl/cer_n.crt;

    ssl_certificate_key /etc/nginx/conf.d/ssl/cer_n.key;

    server_name domain_n;

    location / {

       //location配置略

    }

}

5.找CA为每个域名申请一个证书,将证书放到sever配置的路径

6.service nginx restart

7.浏览器用https访问验证

猜你喜欢

转载自focus-zhong.iteye.com/blog/2347037