Nginx 启用HTTPS

网站使用Let's Encrypt的免费证书,通过默认推荐的Certbot自动配置。

Install

1
$ sudo apt-get install certbot python-certbot-nginx -t stretch-backports

Get Started

自动配置nginx

1
$ sudo certbot --nginx

或者

1
$ sudo certbot -a dns-plugin -i nginx -d "*.example.com" -d example.com --server https://acme-v02.api.letsencrypt.org/directory

Automating renewal

首先测试是否可以更新。

1
$ sudo certbot renew --dry-run

默认可以启用在systemd中的certbot-renew.timer自动更新定时器。

Certbot

0%