gongxiangp2/docs/NETWORK_TOPOLOGY.md

179 lines
5.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 网络拓扑文档
> 最后更新:2026-03-13
> 本文档优先记录“当前现网已验证的对外行为”和“项目内实际配置”。南京入口机的内层转发细节,如需继续下钻,请以服务器现场配置为准。
## 当前结论
- 主站主域名:`sc.jiansun.vip -> 180.97.221.140`
- 当前主站入口已经切到南京服务器
- 旧主站域名:`3d.yydd.ai -> 103.146.230.120`
- 现网行为是 `301` 跳转到 `https://sc.jiansun.vip/`
- 资源域名:`s3.yydd.ai -> 103.146.230.120`
- 当前仍作为公开 S3 / MinIO 资源域名
- 项目运行配置已经切到新主域名:
- `APP_PUBLIC_URL=https://sc.jiansun.vip`
- `NEXTAUTH_URL=https://sc.jiansun.vip`
- 项目运行配置还没有切走旧资源域名:
- `S3_PUBLIC_DOMAIN=https://s3.yydd.ai/gongxiangpan`
## 当前对外链路
### 1. 主站访问
```text
公网用户
-> DNS
-> sc.jiansun.vip
-> 180.97.221.140(南京入口机)
-> 当前站点入口
-> 登录页 / 首页 / API
```
说明:
- 备案完成后,主站对外入口已经从旧方案切到南京服务器
- 仓库内没有保存南京入口机完整 nginx / FRP 配置,因此这里只记录已验证的入口行为,不强行推断内层链路
### 2. 旧主站域名兼容
```text
公网用户
-> 3d.yydd.ai
-> 103.146.230.120
-> nginx 301
-> https://sc.jiansun.vip/
```
说明:
- `3d.yydd.ai` 现在主要承担旧域名兼容和跳转入口,不再作为默认主站域名使用
### 3. 资源访问
```text
公网用户
-> s3.yydd.ai
-> 103.146.230.120
-> MinIO / S3 资源服务
```
说明:
- 当前主站入口和资源入口不在同一公网 IP 上
- 排障时必须把“主站域名链路”和“资源域名链路”分开判断
## 已验证证据
### 1. 公网 DNS(2026-03-13)
- `sc.jiansun.vip -> 180.97.221.140`
- `3d.yydd.ai -> 103.146.230.120`
- `s3.yydd.ai -> 103.146.230.120`
以上结论已用公网 DoH 实测确认:
- `https://dns.google/resolve?name=sc.jiansun.vip&type=A`
- `https://dns.google/resolve?name=3d.yydd.ai&type=A`
- `https://dns.google/resolve?name=s3.yydd.ai&type=A`
### 2. HTTP 行为(2026-03-13)
- `curl -I https://sc.jiansun.vip`
- 返回 `307` 到 `/login`,继续访问可得到 `200 OK`
- 响应头包含 `X-Powered-By: Next.js`
- `curl -I https://3d.yydd.ai`
- 返回 `301 Moved Permanently`
- `Location: https://sc.jiansun.vip/`
- `curl -I https://s3.yydd.ai`
- 返回对象存储风格的 `400 Bad Request`
## 项目内对应配置
### 1. 主域名配置
- `docker-compose.yml`
- `APP_PUBLIC_URL=https://sc.jiansun.vip`
- `NEXT_PUBLIC_DINGTALK_CALLBACK_ORIGIN=https://sc.jiansun.vip`
- `NEXTAUTH_URL=https://sc.jiansun.vip`
- `lib/public-app-url.ts`
- 默认对外主域名是 `https://sc.jiansun.vip`
- 旧域名 `https://3d.yydd.ai` 保留在兼容列表中
### 2. 对外下载链接生成
- `app/api/external/product-assets/route.ts`
- `app/api/external/standard-model-white-background/route.ts`
这两个外部接口都会通过 `getPublicAppOrigin()` 生成对外下载链接,因此默认会落到 `sc.jiansun.vip`。
### 3. 资源域名配置
- `docker-compose.yml`
- `S3_PUBLIC_DOMAIN=https://s3.yydd.ai/gongxiangpan`
- `lib/url-rewrite.ts`
- 仍把 `s3.yydd.ai` 视为当前公网资源域名
### 4. 历史南京直连口痕迹
- `middleware.ts` 里仍保留 `http://180.97.221.140:2320`
这说明:
- 项目内还保留着南京旧 TCP 直连口的兼容痕迹
- 但当前对外主站口径应以 `https://sc.jiansun.vip` 为准
## 口径变更说明
- `2026-03-09` 那版文档里把 `103.146.230.120` 写成“当前公网主入口”,这个口径现在已经失效
- 当前正确口径应当是:
- `sc.jiansun.vip`:主站主域名,当前解析到南京 `180.97.221.140`
- `3d.yydd.ai`:旧主站域名,当前保留跳转
- `s3.yydd.ai`:资源域名,当前仍走 `103.146.230.120`
- 也就是说,这次切换不是“所有域名都切到南京”,而是“主站域名切到南京,资源域名暂未切走”
## 当前风险与待确认项
- 主站入口和资源入口分属不同公网 IP,网络问题不能混看
- 仓库内未保存南京入口机完整的现场配置
- 如果后续要继续追 `sc.jiansun.vip` 的内层代理路径,需要直接登录 `180.97.221.140` 核对
- `103.146.230.120` 当前仍承担:
- `3d.yydd.ai` 的跳转入口
- `s3.yydd.ai` 的资源入口
## 推荐验证命令
### 公网 DNS 验证
```bash
curl -sS "https://dns.google/resolve?name=sc.jiansun.vip&type=A"
curl -sS "https://dns.google/resolve?name=3d.yydd.ai&type=A"
curl -sS "https://dns.google/resolve?name=s3.yydd.ai&type=A"
```
### HTTP 行为验证
```bash
curl -I https://sc.jiansun.vip
curl -I https://3d.yydd.ai
curl -I https://s3.yydd.ai
```
### 跳转结果验证
```bash
curl -I -L https://3d.yydd.ai
curl -I -L https://sc.jiansun.vip
```
## 当前建议
- 对外沟通时,主站统一写 `https://sc.jiansun.vip`
- 旧域名 `https://3d.yydd.ai` 只作为兼容跳转说明,不再作为默认示例地址
- 资源直链示例仍使用 `https://s3.yydd.ai`
- 后续如果资源域名也切换,需要单独再更新:
- `docker-compose.yml`
- `lib/url-rewrite.ts`
- `next.config.js`
- 网络诊断与对外接口文档