server {
        listen        443 ssl;
        server_name       www.xxx.cn localhost;  #xxx填对应域名
        ssl_certificate      xxx.crt;     #xxx对应证书
        ssl_certificate_key  xxx.key;   #xxx对应证书秘钥
        ssl_session_cache    shared:SSL:1m;
        ssl_session_timeout  5m;
        ssl_ciphers  HIGH:!aNULL:!MD5;
        ssl_prefer_server_ciphers  on;
        location / {
            root   html;
            index  index.html index.htm;
        }然后重启nginx:/usr/local/nginx/sbin/nginx -s reload 通过浏览器访问https://域名
原文:http://blog.51cto.com/vaedit/2116601