域名与 HTTPS
组织级 DNS、证书与统一入口。单系统 HTTPS 步骤仍以各系统部署文档为准。
DNS
*.bucssa.org 中走本机的记录指向主服务器公网地址。变更后等解析生效,再用 curl -I https://<域名>/ 核对。
不在本机的记录(官网、文档站、抽奖前端、选举等)由对应托管平台或 Cloudflare 管理,不要在这台机器上找对应进程。
证书
签发方式:Let's Encrypt + Certbot(--nginx)。证书目录:/etc/letsencrypt/live/<域名>/。
当前本机 live 目录包括:
portal.bucssa.orgapplication-portal.bucssa.orgdrive.bucssa.orgapi.lottery.bucssa.orgai.bucssa.orgapi.lottery-staging.bucssa.org(遗留,未挂 Nginx)
续期:系统带 /etc/cron.d/certbot;在 systemd 机器上以 certbot.timer 为准。续期窗口约到期前 30 天。
sudo certbot certificates
sudo certbot renew --dry-run
反向代理(Nginx)
站点配置:
- 源文件:
/etc/nginx/sites-available/ - 启用:
/etc/nginx/sites-enabled/中的符号链接
| 文件 | server_name | 上游 |
|---|---|---|
portal.bucssa.org | portal.bucssa.org | http://127.0.0.1:8000 |
bucssa_portal | application-portal.bucssa.org | http://127.0.0.1:8081 |
drive.bucssa.org | drive.bucssa.org | http://127.0.0.1:8080 |
lottery-staging | api.lottery.bucssa.org | http://127.0.0.1:4000(含 Upgrade) |
ai.bucssa.org | ai.bucssa.org | http://127.0.0.1:3002 |
改配置后:
sudo nginx -t
sudo systemctl reload nginx
抽奖 API 必须保留 WebSocket Upgrade 头;CSSA GPT 必须保留流式相关指令(见 GPT · Nginx HTTPS)。
变更检查清单
- DNS 已指向预期目标
-
certbot certificates显示未过期 -
nginx -t通过后再 reload - 关键 URL 返回合理状态码(200 或业务上的 302)