nginx配置
测试系统:Debian11 1.安装升级系统 sudo apt update 2.安装nginx sudo apt install nginx 3.申请域名 github学生包或者freenom免费域名,添加域名解析,使用nslookup命令查看是否解析成功,注意先不要使用cdn 4.申请证书 zerossl或者letsencrypt即可 80端口验证 sudo apt install python3-certbot-nginx 安装完成后: sudo certbot –nginx 邮箱系统验证 dns验证 泛域名申请 以cloudflare为例: 创建cloudflare api密钥,记下token 创建cloudflare.ini配置文件并放入指定位置 dns_cloudflare_api_token = your_token 申请证书 certbot certonly \ --dns-cloudflare \ --dns-cloudflare-credentials ~/.secrets/certbot/cloudflare.ini \ -d example.com \ -d www.example.com 二级域名申请 sudo certbot -d my.example.com --manual --preferred-challenges dns certonly 注:根据提示添加txt域名映射记录,待域名生效后即可回车 5.编辑nginx配置文件 编辑/etc/nginx/sites-enabled/default文件 server { # SSL configuration # # listen 443 ssl default_server; # listen [::]:443 ssl default_server; # # Note: You should disable gzip for SSL traffic....