阿里云https证书

阿里云可以申请免费证书,赛门铁克DV SSL,每个账号总共可申请20次,申请一次有效期一年,最多保护一个明细子域名,不支持通配符

下载生成好的文件有两个,.pem(证书文件).key(私钥文件),


在Nginx的安装目录下创建cert目录,并且将下载的全部文件拷贝到cert目录中。


nginx配置:

server {  
    listen  80;
    server_name localhost;
    rewrite ^(.*)$  https://$host$1 permanent;
} 

server {
    listen 443;
    server_name localhost;
    ssl on;
    root html;
    index index.html index.htm;
    ssl_certificate   cert/214029015360558.pem;
    ssl_certificate_key  cert/214029015360558.key;
    ssl_session_timeout 5m;
    ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_prefer_server_ciphers on;
    location / {
        root html;
        index index.html index.htm;
    }
}



标签: lnmp https
2017.2.28   /   热度:1301   /   分类: lnmp

发表评论:

©地球仪的BLOG  |  Powered by Emlog