参考文档:
- 首先,添加存储库。
sudo add-apt-repository ppa:certbot/certbot
- 你需要按下ENTER接受。然后,更新包列表以获取新存储库的包信息。
sudo apt-get update
- 最后,安装Certbot的Nginx软件包apt-get。
sudo apt-get install python-certbot-nginx
- 配置好nginx的server_name 指向需要的地址。
server {
listen 80;
server_name xx.xxx.com;
location / {
add_header Access-Control-Allow-Origin *;
proxy_pass http://localhost:8080;
}
}
- 设置SSL
sudo certbot --nginx -d xx.xxx.com