185 lines
10 KiB
Markdown
185 lines
10 KiB
Markdown
# Salon 域名与对象存储入口核对记录
|
||
|
||
更新时间:2026-11-01
|
||
|
||
## 范围和结论
|
||
|
||
本次只整理 DEV 与 SIT;PROD 不处理。DEV 不建设公网入口,继续使用内网 MinIO;当前主要目标是 SIT 的 Salon 前端/API 和 MinIO HTTPS 入口。
|
||
|
||
| 项目 | DEV | SIT | 状态 |
|
||
| --- | --- | --- | --- |
|
||
| Salon 业务入口 | 不配置公网入口 | `https://sit.salon.yunail.art` | 阿里云1 Nginx、DNS、TLS 已完成并验收 |
|
||
| MinIO 内网 endpoint | `http://192.168.5.15:9000` | `http://192.168.10.14:9000` | 保留服务端内网访问 |
|
||
| MinIO 公网签名 endpoint | 不设置,沿用内网 endpoint | `https://sit.minio.yunail.art` | 阿里云1 Nginx、DNS、TLS 已完成并验收 |
|
||
| 七牛加速域名 | `https://dev.qiniu.yunail.art` | `https://sit.qiniu.yunail.art` | 仓库配置已调整;此前核查 CNAME 分别指向七牛分配的目标且 HTTPS 可达,私有桶根路径 403 属正常访问控制表现 |
|
||
| PROD | 不在范围内 | 不在范围内 | 保持现状 |
|
||
|
||
旧 SIT 业务域名 `sit.yunail.art` 暂时保留兼容,不在本次撤销或改写。阿里云1上两个新域名均解析到 `8.137.35.61`,并使用同一张证书;本机解析工具返回的保留网段地址属于测试环境合成结果,不能用于判断公网 DNS。
|
||
|
||
## 仓库变更
|
||
|
||
- SIT 工作流的 Salon API、后台 API、部署健康检查基址及回退工作流切换到 `https://sit.salon.yunail.art`。
|
||
- 小程序体验版接口域名切换到 `https://sit.salon.yunail.art/api`;正式版地址不变。
|
||
- DEV/SIT Salon 七牛域名分别改为 `https://dev.qiniu.yunail.art`、`https://sit.qiniu.yunail.art`;ArtList 配置未修改。
|
||
- MinIO 增加可选 `minio.public-endpoint`。应用上传、下载、删除及内部对象读写仍走 `minio.endpoint`;只有私有对象签名使用专用客户端和公网 endpoint。未配置时签名客户端退回内网 endpoint,保持现有环境兼容。
|
||
- SIT Core/Gateway 部署工作流和历史 SIT 清单使用 `192.168.10.15`,仓库原业务服务器总表曾写 `192.168.10.106`。总表已按当前工作流和 SIT 清单统一为 `.15`,但实际启用 Nginx upstream 前仍须从阿里云1和 SIT 主机确认网络可达与监听端口。
|
||
|
||
## SIT DNS 与入口拓扑
|
||
|
||
预期拓扑:
|
||
|
||
```text
|
||
sit.salon.yunail.art -> 阿里云1公网 A 记录 -> 阿里云1 Nginx -> SIT Gateway 192.168.10.15:180
|
||
sit.minio.yunail.art -> 与 sit.salon 相同的阿里云1公网 A 记录 -> 阿里云1 Nginx -> MinIO 192.168.10.14:9000
|
||
```
|
||
|
||
DNS 变更前应读取 `sit.salon.yunail.art` 当前权威 A/AAAA 记录,并将 `sit.minio.yunail.art` 指向同一阿里云1公网入口;不要从受限的本机 DNS 结果推断公网 IP。若 `sit.minio` 已有 AAAA 记录,还需确认该 IPv6 入口的 Nginx/TLS 已配置,否则移除错误 AAAA 或补齐 IPv6 服务。
|
||
|
||
阿里云1 WireGuard 地址为 `10.66.0.3`,SIT Web 部署目录为 `/opt/jc-salon-frontend-sit`,发布脚本将静态站点链接到 `current`。最终 Nginx 配置须以服务器现有配置为基础合并,不能覆盖 ArtList 或生产站点。以下是配置目标示例;上游 IP/端口需先确认:
|
||
|
||
```nginx
|
||
upstream salon_sit_gateway {
|
||
server 192.168.10.15:180;
|
||
keepalive 32;
|
||
}
|
||
|
||
upstream salon_sit_minio {
|
||
server 192.168.10.14:9000;
|
||
keepalive 32;
|
||
}
|
||
|
||
server {
|
||
listen 80;
|
||
server_name sit.salon.yunail.art sit.minio.yunail.art;
|
||
# HTTP-01 验证期间保留 ACME challenge 可访问;其余请求跳转 HTTPS。
|
||
location ^~ /.well-known/acme-challenge/ {
|
||
root /var/www/letsencrypt;
|
||
}
|
||
location / { return 301 https://$host$request_uri; }
|
||
}
|
||
|
||
server {
|
||
listen 443 ssl;
|
||
server_name sit.salon.yunail.art;
|
||
ssl_certificate /etc/letsencrypt/live/salon-sit.yunail.art/fullchain.pem;
|
||
ssl_certificate_key /etc/letsencrypt/live/salon-sit.yunail.art/privkey.pem;
|
||
|
||
root /opt/jc-salon-frontend-sit/current;
|
||
index index.html;
|
||
client_max_body_size 20m;
|
||
proxy_connect_timeout 10s;
|
||
proxy_send_timeout 300s;
|
||
proxy_read_timeout 300s;
|
||
|
||
location /api/ {
|
||
proxy_pass http://salon_sit_gateway;
|
||
proxy_set_header Host $http_host;
|
||
proxy_set_header X-Real-IP $remote_addr;
|
||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||
proxy_set_header X-Forwarded-Proto $scheme;
|
||
}
|
||
location /admin/api/ {
|
||
proxy_pass http://salon_sit_gateway;
|
||
proxy_set_header Host $http_host;
|
||
proxy_set_header X-Real-IP $remote_addr;
|
||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||
proxy_set_header X-Forwarded-Proto $scheme;
|
||
}
|
||
location = /health/check {
|
||
proxy_pass http://salon_sit_gateway;
|
||
proxy_set_header Host $http_host;
|
||
proxy_set_header X-Forwarded-Proto $scheme;
|
||
}
|
||
location / {
|
||
try_files $uri $uri/ /index.html;
|
||
}
|
||
}
|
||
|
||
server {
|
||
listen 443 ssl;
|
||
server_name sit.minio.yunail.art;
|
||
ssl_certificate /etc/letsencrypt/live/salon-sit.yunail.art/fullchain.pem;
|
||
ssl_certificate_key /etc/letsencrypt/live/salon-sit.yunail.art/privkey.pem;
|
||
|
||
client_max_body_size 100m;
|
||
proxy_http_version 1.1;
|
||
proxy_buffering off;
|
||
proxy_request_buffering off;
|
||
proxy_connect_timeout 10s;
|
||
proxy_send_timeout 300s;
|
||
proxy_read_timeout 300s;
|
||
|
||
location / {
|
||
# MinIO SigV4 依赖原始 Host 和 URI;不得改写 Host、路径或查询参数。
|
||
proxy_pass http://salon_sit_minio;
|
||
proxy_set_header Host $http_host;
|
||
proxy_set_header X-Real-IP $remote_addr;
|
||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||
proxy_set_header X-Forwarded-Proto $scheme;
|
||
proxy_set_header Connection "";
|
||
}
|
||
}
|
||
```
|
||
|
||
MinIO Console `9001` 不配置公网 upstream;阿里云安全组和 Nginx 均不得开放公网到 `9001`。`proxy_pass` 不附带 URI 后缀,避免改写 MinIO 签名 URL 的原始路径和查询串。SIT Gateway 工作流健康端口为 `180`,Core 健康端口为 `181`;公网 `/api` 与 `/admin/api` 都按现有 Gateway 路由转发。
|
||
|
||
## TLS 与续签
|
||
|
||
在阿里云1确认 Nginx 版本、发行版及现有 Certbot 安装方式后,为两个域名签发同一张证书:
|
||
|
||
```bash
|
||
certbot renew --cert-name salon-sit.yunail.art --dry-run
|
||
systemctl list-timers --all | grep -i certbot
|
||
```
|
||
|
||
必须确保公网 TCP/80 可达以完成 HTTP-01,并允许 TCP/443 提供业务。续签钩子在成功签发后执行 `nginx -t && systemctl reload nginx`。完成后检查证书 SAN 同时包含两个 SIT 域名、有效期、续签 dry-run、systemd timer 和钩子。
|
||
|
||
## 验收清单
|
||
|
||
### DNS / TLS
|
||
|
||
- 从至少两个独立公网 DNS 解析器查询 `sit.salon.yunail.art`、`sit.minio.yunail.art`,确认 A 地址相同且为阿里云1公网 IP;检查 AAAA 不会引流到未配置的 IPv6 入口。
|
||
- 检查 `dev.qiniu.yunail.art`、`sit.qiniu.yunail.art` 的 CNAME 指向七牛分配目标;HTTPS TLS 主机名匹配。
|
||
- 检查两个 SIT 域名证书 SAN、到期时间、Certbot timer 与 `renew --dry-run`。
|
||
|
||
### 应用 / MinIO
|
||
|
||
- `https://sit.salon.yunail.art/` 返回 Salon 前端;`/api/health/check` 或当前实际健康路由可达。
|
||
- `/api`、`/admin/api` 请求到达 SIT Gateway;`/health/check` 满足发布脚本健康检查。
|
||
- `https://sit.minio.yunail.art/minio/health/live` 返回真实 MinIO 健康状态。
|
||
- 从 SIT Core 生成的私有 MinIO 签名 URL 主机名为 `sit.minio.yunail.art`,对象可读;过期后返回拒绝。
|
||
- 验证同一对象的七牛签名读取和过期行为;私有桶根路径 403 不作为失败判据。
|
||
- 外网无法连接 MinIO `9001`;只允许 Nginx 必需的 80/443 暴露。
|
||
|
||
### 仓库
|
||
|
||
- YAML 解析、Salon Core 测试/编译、小程序配置静态检查、`git diff --check` 和 GitNexus 变更检查。
|
||
- SIT 发布应通过现有 `sit` 分支工作流发布 Core 配置和工作流生成的前端/API 地址;本次不直接写入实际 Nacos。
|
||
|
||
## 2026-11-01 阿里云1 SIT HTTPS 实施结果
|
||
|
||
已通过 WireGuard 地址 `10.66.0.3` 登录阿里云1并完成只影响 SIT 新域名的 Nginx 配置:
|
||
|
||
- 新增 `/etc/nginx/conf.d/salon-sit-http.conf`,并在 `/etc/nginx/nginx.conf` 的显式 include 列表中加入该文件。
|
||
- `sit.salon.yunail.art` 的前端、`/api/`、`/admin/api/` 和 `/health/check` 分别按目标转发到 SIT 前端目录和 `192.168.10.15:180`。
|
||
- `sit.minio.yunail.art` 保留原始 Host、URI 和查询参数,转发到 `192.168.10.14:9000`。
|
||
- 创建 `/var/www/letsencrypt` 作为 ACME challenge 目录;80 端口仅保留 challenge,其余请求统一 301 到 HTTPS。
|
||
- 证书 cert-name 为 `salon-sit.yunail.art`,SAN 包含 `sit.salon.yunail.art` 和 `sit.minio.yunail.art`,证书有效期至 2027-01-30。
|
||
- 变更前已备份 Nginx、conf.d 和 Certbot 目录,相关备份目录为 `/root/codex-backups/nginx-salon-sit-20261101221430`、`/root/codex-backups/nginx-salon-sit-cert-20261101231024`、`/root/codex-backups/nginx-salon-sit-https-20261101231455`、`/root/codex-backups/nginx-salon-sit-clean-20261101231742`。
|
||
- 已安装 `/etc/letsencrypt/renewal-hooks/deploy/reload-nginx.sh`,续签后先执行 `nginx -t`,通过后 reload Nginx。
|
||
- `nginx -t` 通过,Nginx 已 reload 且保持 active;旧 `sit.yunail.art` 站点行为未改动。
|
||
|
||
远端 HTTPS 验收通过:
|
||
|
||
- `https://sit.salon.yunail.art/` 返回前端 200;`/health/check` 返回 Gateway 健康结果。
|
||
- `/api/health/check` 返回 Core 健康结果;`/admin/api` 正确返回未认证状态。
|
||
- `https://sit.minio.yunail.art/minio/health/live` 返回 200;本机 `9001` 未监听。
|
||
- 两个 HTTP 入口均返回 301 到对应 HTTPS 地址。
|
||
- `nginx -t` 通过且 reload 成功;`certbot-renew.timer` 已启用,SIT renewal dry-run 成功。
|
||
|
||
## 遗留事项
|
||
|
||
- `/etc/letsencrypt/renewal/yunail.art.conf` 是历史生产 renewal 配置,Certbot 报告其证书文件布局不完整。本次未修改生产证书和旧站点,需后续单独核对证书指纹及归档后修复。
|
||
- PROD 入口、PROD MinIO、DEV 公网入口均不在本次范围内。
|
||
- 公网 DNS 独立解析器、七牛已有对象签名读取和 SIT 真实对象签名过期行为仍应在发布验收窗口按清单复核;本次不在日志或文档中记录完整签名 URL。
|