163 lines
8.7 KiB
Markdown
163 lines
8.7 KiB
Markdown
# Salon 域名与对象存储入口核对记录
|
||
|
||
更新时间:2026-10-31
|
||
|
||
## 范围和结论
|
||
|
||
本次只整理 DEV 与 SIT;PROD 不处理。DEV 不建设公网入口,继续使用内网 MinIO;当前主要目标是 SIT 的 Salon 前端/API 和 MinIO HTTPS 入口。
|
||
|
||
| 项目 | DEV | SIT | 状态 |
|
||
| --- | --- | --- | --- |
|
||
| Salon 业务入口 | 不配置公网入口 | `https://sit.salon.yunail.art` | 仓库配置已调整;阿里云1 Nginx、DNS 和证书尚未远端实施 |
|
||
| MinIO 内网 endpoint | `http://192.168.5.15:9000` | `http://192.168.10.14:9000` | 保留服务端内网访问 |
|
||
| MinIO 公网签名 endpoint | 不设置,沿用内网 endpoint | `https://sit.minio.yunail.art` | SIT 仓库配置已调整;Nginx、DNS 和证书尚未远端实施 |
|
||
| 七牛加速域名 | `https://dev.qiniu.yunail.art` | `https://sit.qiniu.yunail.art` | 仓库配置已调整;此前核查 CNAME 分别指向七牛分配的目标且 HTTPS 可达,私有桶根路径 403 属正常访问控制表现 |
|
||
| PROD | 不在范围内 | 不在范围内 | 保持现状 |
|
||
|
||
旧 SIT 业务域名 `sit.yunail.art` 暂时保留兼容,不在本次撤销或改写。此前从阿里云1验证该域名可返回健康检查;新域名此前检查到证书主机名不匹配。`192.168.10.14:9000/minio/health/live` 曾返回真实 MinIO 健康响应。DNS 最终结果必须从独立公网 DNS 解析器重新确认;本机解析结果曾出现保留网段地址,不能据此填写 A 记录。
|
||
|
||
## 仓库变更
|
||
|
||
- 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 http2;
|
||
server_name sit.salon.yunail.art;
|
||
ssl_certificate /etc/letsencrypt/live/sit.salon.yunail.art/fullchain.pem;
|
||
ssl_certificate_key /etc/letsencrypt/live/sit.salon.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 http2;
|
||
server_name sit.minio.yunail.art;
|
||
ssl_certificate /etc/letsencrypt/live/sit.salon.yunail.art/fullchain.pem;
|
||
ssl_certificate_key /etc/letsencrypt/live/sit.salon.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 --nginx -d sit.salon.yunail.art -d sit.minio.yunail.art
|
||
certbot renew --dry-run
|
||
systemctl list-timers --all | grep -i certbot
|
||
```
|
||
|
||
必须确保公网 TCP/80 可达以完成 HTTP-01,并允许 TCP/443 提供业务。若系统没有 Certbot 自动定时器,应按该发行版安装包启用 systemd timer/cron;部署续签 hook,在续签成功后执行 `nginx -t && systemctl reload nginx`。完成后检查证书 SAN 同时包含两个 SIT 域名、有效期和续签 dry-run。不能只配置证书而不验收 timer 与 reload hook。
|
||
|
||
## 验收清单
|
||
|
||
### 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。
|
||
|
||
## 尚未执行的远端事项
|
||
|
||
现有 SSH 身份认证无法登录阿里云1,因此本次没有修改 DNS、Nginx、Certbot、防火墙、安全组或真实 Nacos,也没有宣称 SIT 公网验收完成。取得可用授权 SSH 方式后,先只读检查阿里云1上的站点配置、证书、续签任务和防火墙,再备份配置;核实 DNS 目标与 SIT Gateway 地址/端口后再分阶段变更,并逐项执行上方验收。若 `.15` 与服务器总表 `.106` 的差异未在现网确认,应先修正目标地址再加 Nginx upstream。
|