Nginx部署https网站

第一步:修改配置文件(nginx.conf):

# 省略其他配置信息
......
http {
    include        mime.types;
    default_type   application/octet-stream;
    sendfile       on;
    keepalive_timeout  65;
    charset   utf-8;

    server {
        listen  443;
        server_name   www.baidu.com;
        ssl   on;
        ssl_certificate        cert/baidu.com.crt; # https证书
        ssl_certificate_key    cert/baidu.com.key; # RSA私钥
        ssl_session_timeout   5m;
        ssl_protocols   TLSv1.2;
        ssl_ciphers    HIGH:!aNULL:!MD5;
        ssl_prefer_server_ciphers   on;
        location / {
            root   html;
            index  index.html index.php;
        }
    }
}
# 省略其他配置信息
......

第二步:启动Nginx

./nginx.exe