用 Certbot 搭配 Nginx 建立具有 HTTPS 的网站
安装 Nginx 与 Certbot
我的配置是:
操作系统: Alpine Linux Edge
编辑 /etc/apk/repositories,打开 community 源,然后运行:
1 | apk add nginx certbot certbot-nginx |
添加配置
创建一个配置文件:
1 | nano /etc/nginx/conf.d/your.domain.site.conf |
在里面填写以下内容:
1 | server { |
保存文件,然后运行:
1 | certbot -d your.domain.site -m your@email.site |
-d后面是你的域名,-m后面是你的邮箱。