nginx配置https

  •   首先修改原来的nginx配置,nginx配置不会的看>>这里

    server {
    listen 80;
    # 添加
    listen 443 ssl;
    server_name www.wxy.email wxy.email;

    # 添加ssl证书配置
    # ssl on;
    ssl_certificate /home/lls/wxy.email.crt;
    ssl_certificate_key /home/lls/wxy.email.key;
    ssl_session_timeout 5m;

    charset utf-8;
    location / {
    root /home/blog/blog;
    index index.html;
    }
    }
  •   kill杀死nginx进程,重启

    kill -9 <pid>
    service nginx start

  本文链接:时光不写博客-https配置