在 Debian 上安装 Nginx 并配置 SSL,通常可以按 6 步 来做(以免费 Let’s Encrypt 证书为例,最常用):
sudo apt update
sudo apt upgrade -y
sudo apt install nginx -y
sudo ufw allow 'Nginx Full'
sudo apt install certbot python3-certbot-nginx -y
sudo certbot --nginx -d yourdomain.com -d www.yourdomain.com
把
yourdomain.com换成你的域名,且域名要已解析到服务器 IP
sudo certbot renew --dry-run
步骤会少一点(约 4 步):
openssl 生成证书如果你告诉我:
我可以给你精确到命令的版本。