lishengzxc / bblog

My Blog
https://github.com/lishengzxc/bblog/issues
178 stars 8 forks source link

HTTPS #26

Open lishengzxc opened 7 years ago

lishengzxc commented 7 years ago

https://certbot.eff.org/#ubuntuxenial-nginx

server {
  listen 443 ssl;
  server_name blog.lishengcn.cn;
  root /home/ubuntu/blog;

  ssl_certificate            /etc/letsencrypt/live/lishengcn.cn/fullchain.pem;
  ssl_certificate_key        /etc/letsencrypt/live/lishengcn.cn/privkey.pem;
  ssl_protocols              TLSv1 TLSv1.1 TLSv1.2;
  ssl_prefer_server_ciphers  on;
  ssl_ciphers                AES256+EECDH:AES256+EDH:!aNULL;

  location /api {
    rewrite ^.+api/?(.*)$ /$1 break;
    proxy_pass http://127.0.0.1:8080;
  }
}
rewrite ^/(.*) https://$server_name$1 permanent;
letsencrypt certonly --standalone --email a@b.c -d b.c -d a.b.c
lishengzxc commented 7 years ago

https://github.com/mholt/caddy