From f9fc2b658a44460c6e725f877805b599d1f250e9 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 17 Apr 2026 17:34:14 +0800 Subject: [PATCH] docs(spider): add quick verification commands --- docs/2026-04-17-spider-nginx-运维摘要.md | 75 +++++++++++++++++++++++- 1 file changed, 74 insertions(+), 1 deletion(-) diff --git a/docs/2026-04-17-spider-nginx-运维摘要.md b/docs/2026-04-17-spider-nginx-运维摘要.md index 2dab626..441160a 100644 --- a/docs/2026-04-17-spider-nginx-运维摘要.md +++ b/docs/2026-04-17-spider-nginx-运维摘要.md @@ -159,7 +159,80 @@ 1. 把 `bytespider` 纳入 managed spider 映射 2. 再观察其 `robots/home` 命中变化 -## 7. 长文档入口 +## 7. 常用复测命令 + +后续人工或新的 Codex 接手时,优先直接用下面这些命令做快速验证。 + +### 7.1 看普通访问是否仍被前端缓存命中 + +```bash +curl -I -s 'https://你的域名/真实详情或播放页' +``` + +重点看: + +1. `X-Cache-Status` +2. `X-Cache-Mode` +3. `X-Managed-Spider` + +### 7.2 强制绕过前端缓存看最新真实输出 + +```bash +curl -I -s 'https://你的域名/真实详情或播放页?__nocache=1' +``` + +期望看到: + +1. `X-Cache-Status: BYPASS` +2. `X-Cache-Mode: bypass` +3. `X-Cache-Bypass: 1` + +### 7.3 测 `Sogou` 是否已进入放行链 + +```bash +curl -I -s \ + -A 'Sogou web spider/4.0(+http://www.sogou.com/docs/help/webmasters.htm#07)' \ + 'https://你的域名/真实首页或深页' +``` + +重点看: + +1. HTTP 状态是否为 `200` +2. `X-Managed-Spider` 是否为 `managed` + +### 7.4 测 `Baiduspider` 是否已正常命中 + +```bash +curl -I -s \ + -A 'Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www.baidu.com/search/spider.html)' \ + 'https://你的域名/真实首页或深页' +``` + +### 7.5 测 `Bytespider` + +```bash +curl -I -s \ + -A 'Mozilla/5.0 (compatible; Bytespider; +http://spider.bytedance.com/)' \ + 'https://你的域名/robots.txt' +``` + +当前预期: + +1. 多数站 `robots.txt` 已能拿到 `200` +2. 但 `X-Managed-Spider` 可能仍为 `normal` + +### 7.6 看首页里当前真实路由模式 + +```bash +curl -s 'https://你的域名/' | rg -o 'href=["'\"'\"']/[^"'\"'\"']+' | head -n 80 +``` + +用途: + +1. 快速确认当前站是真实使用 `/movie/...`、`/neirong-...`、`/shipin/...` 还是别的路由族 +2. 避免把旧日志路径当成当前真实路径 + +## 8. 长文档入口 完整细节、样本、时间线、实测证据统一在: