From 9ce42ed5acbe23a7ad5d883aba1f34d59e6edf6c Mon Sep 17 00:00:00 2001 From: hailin Date: Wed, 11 Feb 2026 05:18:22 -0800 Subject: [PATCH] chore: Switch domain from admin.gogenex.com to admin.gogenex.cn MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 使用国内 .cn 域名用于 ICP 备案,支持国内 IP 直连加速。 国际域名 gogenex.com 保留在 Namecheap 不受影响。 变更: - deploy.sh: 默认域名/邮箱改为 admin.gogenex.cn - nginx 配置: 重命名为 admin.gogenex.cn.conf,替换所有域名引用 - DEPLOY.md: 更新所有域名引用 Co-Authored-By: Claude Opus 4.6 --- frontend/admin-web/DEPLOY.md | 28 +++++++++---------- frontend/admin-web/deploy.sh | 10 +++---- ...gogenex.com.conf => admin.gogenex.cn.conf} | 16 +++++------ 3 files changed, 27 insertions(+), 27 deletions(-) rename frontend/admin-web/nginx/{admin.gogenex.com.conf => admin.gogenex.cn.conf} (86%) diff --git a/frontend/admin-web/DEPLOY.md b/frontend/admin-web/DEPLOY.md index 2aeee0f..f08bfd7 100644 --- a/frontend/admin-web/DEPLOY.md +++ b/frontend/admin-web/DEPLOY.md @@ -19,7 +19,7 @@ frontend/admin-web/ ├── Dockerfile # 三阶段 Docker 构建 ├── docker-compose.yml # Docker Compose 编排 ├── nginx/ -│ └── admin.gogenex.com.conf # Nginx HTTPS 配置模板 +│ └── admin.gogenex.cn.conf # Nginx HTTPS 配置模板 ├── package.json # Next.js 15 + React 18 ├── next.config.ts # Next.js 配置 (standalone 输出) ├── tsconfig.json # TypeScript 配置 @@ -45,7 +45,7 @@ cd frontend/admin-web sudo ./deploy.sh nginx install ``` -部署完成后访问: https://admin.gogenex.com +部署完成后访问: https://admin.gogenex.cn --- @@ -79,11 +79,11 @@ curl http://localhost:3000/api/health 在域名 DNS 管理中添加 A 记录: ``` -admin.gogenex.com → <服务器公网 IP> +admin.gogenex.cn → <服务器公网 IP> ``` 确保: -- DNS 已生效 (可用 `dig admin.gogenex.com` 验证) +- DNS 已生效 (可用 `dig admin.gogenex.cn` 验证) - 服务器防火墙已放行 80 和 443 端口 ### 第三步: 安装 Nginx + SSL 证书 @@ -136,7 +136,7 @@ sudo ./deploy.sh nginx ssl [域名] [邮箱] sudo ./deploy.sh nginx reload ``` -默认域名: `admin.gogenex.com`,默认邮箱: `admin@gogenex.com` +默认域名: `admin.gogenex.cn`,默认邮箱: `admin@gogenex.com` ### 自定义域名部署 @@ -144,8 +144,8 @@ sudo ./deploy.sh nginx reload ```bash # 1. 复制并修改 Nginx 配置模板 -cp nginx/admin.gogenex.com.conf nginx/myapp.example.com.conf -# 编辑文件,替换所有 admin.gogenex.com 为新域名 +cp nginx/admin.gogenex.cn.conf nginx/myapp.example.com.conf +# 编辑文件,替换所有 admin.gogenex.cn 为新域名 # 2. 使用自定义域名安装 sudo ./deploy.sh nginx install myapp.example.com admin@example.com @@ -182,7 +182,7 @@ PORT=8080 ./deploy.sh start ### 证书位置 ``` -/etc/letsencrypt/live/admin.gogenex.com/ +/etc/letsencrypt/live/admin.gogenex.cn/ ├── fullchain.pem # 完整证书链 ├── privkey.pem # 私钥 ├── cert.pem # 服务器证书 @@ -210,7 +210,7 @@ sudo certbot renew ```bash sudo certbot certonly --force-renewal \ --webroot --webroot-path=/var/www/certbot \ - -d admin.gogenex.com + -d admin.gogenex.cn sudo systemctl reload nginx ``` @@ -218,7 +218,7 @@ sudo systemctl reload nginx ## Nginx 配置说明 -HTTPS 配置 (`nginx/admin.gogenex.com.conf`) 包含: +HTTPS 配置 (`nginx/admin.gogenex.cn.conf`) 包含: | 特性 | 说明 | |------|------| @@ -260,14 +260,14 @@ docker compose build --no-cache 2>&1 | tee build.log ### SSL 证书申请失败 常见原因: -1. DNS 未生效 - 用 `dig admin.gogenex.com` 检查 A 记录 +1. DNS 未生效 - 用 `dig admin.gogenex.cn` 检查 A 记录 2. 80 端口未放行 - 用 `sudo ufw allow 80` 放行 3. 防火墙/安全组拦截 - 检查云服务商安全组规则 ```bash # 手动测试 ACME 验证路径 echo "test" > /var/www/certbot/.well-known/acme-challenge/test -curl http://admin.gogenex.com/.well-known/acme-challenge/test +curl http://admin.gogenex.cn/.well-known/acme-challenge/test # 应返回 "test" ``` @@ -278,10 +278,10 @@ curl http://admin.gogenex.com/.well-known/acme-challenge/test ./deploy.sh logs # Nginx 访问日志 -tail -f /var/log/nginx/admin.gogenex.com.access.log +tail -f /var/log/nginx/admin.gogenex.cn.access.log # Nginx 错误日志 -tail -f /var/log/nginx/admin.gogenex.com.error.log +tail -f /var/log/nginx/admin.gogenex.cn.error.log # Certbot 日志 tail -f /var/log/letsencrypt/letsencrypt.log diff --git a/frontend/admin-web/deploy.sh b/frontend/admin-web/deploy.sh index ae696a8..c1c8064 100755 --- a/frontend/admin-web/deploy.sh +++ b/frontend/admin-web/deploy.sh @@ -19,8 +19,8 @@ # ./deploy.sh nginx status 查看 Nginx 状态 # ./deploy.sh nginx reload 重载 Nginx 配置 # -# 默认域名: admin.gogenex.com -# 默认邮箱: admin@gogenex.com +# 默认域名: admin.gogenex.cn +# 默认邮箱: admin@gogenex.cn # # ============================================================================= @@ -38,8 +38,8 @@ PROJECT_NAME="genex-admin-web" IMAGE_NAME="genex-admin-web" CONTAINER_NAME="genex-admin-web" DEFAULT_PORT=3000 -DEFAULT_DOMAIN="admin.gogenex.com" -DEFAULT_EMAIL="admin@gogenex.com" +DEFAULT_DOMAIN="admin.gogenex.cn" +DEFAULT_EMAIL="admin@gogenex.cn" # 脚本目录 SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" @@ -196,7 +196,7 @@ cmd_nginx_install() { log_error "请先在 nginx/ 目录下创建 ${domain}.conf" log_info "" log_info "可以复制模板并修改:" - log_info " cp nginx/admin.gogenex.com.conf nginx/${domain}.conf" + log_info " cp nginx/admin.gogenex.cn.conf nginx/${domain}.conf" log_info " 然后替换其中的域名和端口" exit 1 fi diff --git a/frontend/admin-web/nginx/admin.gogenex.com.conf b/frontend/admin-web/nginx/admin.gogenex.cn.conf similarity index 86% rename from frontend/admin-web/nginx/admin.gogenex.com.conf rename to frontend/admin-web/nginx/admin.gogenex.cn.conf index 547fc7e..eca5396 100644 --- a/frontend/admin-web/nginx/admin.gogenex.com.conf +++ b/frontend/admin-web/nginx/admin.gogenex.cn.conf @@ -1,9 +1,9 @@ # Genex Admin Web - Nginx HTTPS 配置 -# 域名: admin.gogenex.com +# 域名: admin.gogenex.cn # 后端: genex-admin-web (Next.js, 端口 3000) # # 此文件由 deploy.sh nginx install 自动部署到: -# /etc/nginx/sites-available/admin.gogenex.com +# /etc/nginx/sites-available/admin.gogenex.cn # # SSL 证书由 Let's Encrypt (certbot) 自动申请和管理 @@ -11,7 +11,7 @@ server { listen 80; listen [::]:80; - server_name admin.gogenex.com; + server_name admin.gogenex.cn; # Let's Encrypt 验证目录 location /.well-known/acme-challenge/ { @@ -28,11 +28,11 @@ server { server { listen 443 ssl http2; listen [::]:443 ssl http2; - server_name admin.gogenex.com; + server_name admin.gogenex.cn; # SSL 证书 (Let's Encrypt) - ssl_certificate /etc/letsencrypt/live/admin.gogenex.com/fullchain.pem; - ssl_certificate_key /etc/letsencrypt/live/admin.gogenex.com/privkey.pem; + ssl_certificate /etc/letsencrypt/live/admin.gogenex.cn/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/admin.gogenex.cn/privkey.pem; # SSL 配置优化 ssl_session_timeout 1d; @@ -48,8 +48,8 @@ server { add_header Strict-Transport-Security "max-age=63072000" always; # 日志 - access_log /var/log/nginx/admin.gogenex.com.access.log; - error_log /var/log/nginx/admin.gogenex.com.error.log; + access_log /var/log/nginx/admin.gogenex.cn.access.log; + error_log /var/log/nginx/admin.gogenex.cn.error.log; # Gzip 压缩 gzip on;