公开页补齐自引用 Canonical 与按类型的结构化数据,图片补上说明文字。

后台设置和内容编辑改成可导航布局;部署用访客 origin 生成 Canonical,避免落到容器地址。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-20 00:11:24 +08:00
parent 2b3d122e56
commit 40bbad2c82
51 changed files with 3042 additions and 1318 deletions

View File

@@ -8,7 +8,8 @@ JIANG13_VERSION=0.1.0
JIANG13_IMAGE_API=jiang13-bbs-api
JIANG13_IMAGE_WEB=jiang13-bbs-web
# 对外 origin,须与浏览器地址栏一致(含 https、无尾斜杠)。CORS 兜底。
# 对外 origin,须与浏览器地址栏一致(含 https、无尾斜杠)。
# api 用于 CORS;web 用于 Canonical / sitemap / robots(运行时读取,勿写成 http://api:3001)。
SITE_URL=https://bbs.example.com
# 发布到宿主机的地址/端口,供本机 Nginx 反代。默认只绑 loopback。

View File

@@ -52,6 +52,7 @@
| 变量 | 必需 | 说明 |
|------|------|------|
| `BACKEND_URL` | 是 | 固定 `http://api:3001`(SSR / middleware,勿写成公网 URL) |
| `SITE_URL` | 建议 | 与 api 相同的对外 origin。Canonical / sitemap / robots 在**运行时**读取;不要写成 `http://api:3001` |
| `PORT` / `HOSTNAME` | 否 | `3000` / `0.0.0.0` |
| `NEXT_PUBLIC_APP_VERSION` | 构建期 | 与 `VERSION` 相同;**不要**设置 `NEXT_PUBLIC_API_URL=http://api:3001`(会泄漏到浏览器) |

View File

@@ -61,6 +61,7 @@ services:
condition: service_healthy
environment:
BACKEND_URL: http://api:3001
SITE_URL: ${SITE_URL:-https://localhost}
NODE_ENV: production
PORT: "3000"
HOSTNAME: 0.0.0.0

View File

@@ -7,6 +7,13 @@ map $http_upgrade $connection_upgrade {
'' close;
}
# 明文 80 只做跳转,页面与 Cookie 都走 HTTPS
server {
listen 80;
server_name bbs.example.com;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl http2;
server_name bbs.example.com;