feat(seo): robots.txt 与 SEO 解封操作单(blog-5f T1)
robots 404 补齐(Allow 全站/Disallow admin+draft/Sitemap 行); 操作单三步走:nginx snippet 剥 noindex+内部 vhost 补回+admin 局部 保留、ESA purge+TTL+绕缓存、curl 三验证——用户侧执行入口。 验证: T1 verify 命令全过(robots 三断言+操作单节存在) Spec: 2026-10-26_blog-5f Co-authored-by: GLM-5.3
This commit is contained in:
1 parent
5d18591967
commit
22930cfffd
2 files changed
+34
No files matched your search
@@ -36,3 +36,28 @@ sudo bash infra/deploy/rollback.sh --exec # 秒级回 Halo
|
|||||||
- 新文章工作流:本地或 gitea web 写 md → push main → webhook 自动构建发布
|
- 新文章工作流:本地或 gitea web 写 md → push main → webhook 自动构建发布
|
||||||
- 新照片:上传 content/photos/ 后跑 `python3 scripts/photos_ingest.py` 再 commit
|
- 新照片:上传 content/photos/ 后跑 `python3 scripts/photos_ingest.py` 再 commit
|
||||||
- 翻译:新文章 push 后跑 `python3 scripts/translate/translate_posts.py`(幂等)
|
- 翻译:新文章 push 后跑 `python3 scripts/translate/translate_posts.py`(幂等)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## SEO 解封操作单(Phase 5f T1,2026-10-26 立案)
|
||||||
|
|
||||||
|
**背景**:生产全站自上线起带 `X-Robots-Tag: noindex`(/etc/nginx/snippets/esa-origin-ssl.conf:11 共享片段误伤博客 vhost)+ robots.txt 404 + ESA 将带 noindex 的响应头缓存 30 天——搜索引擎全站不可见。
|
||||||
|
|
||||||
|
**第一步:nginx(需 sudo)**
|
||||||
|
1. 编辑 `/etc/nginx/snippets/esa-origin-ssl.conf`:删除第 11 行 `add_header X-Robots-Tag noindex always;`(改前备份 .bak)
|
||||||
|
2. 给确实需要 noindex 的内部服务 vhost(api/oj/token/fc/latex/cpa/git)各 server 块补回该行
|
||||||
|
3. 博客 vhost 补局部:`location /admin/ { add_header X-Robots-Tag noindex always; }`
|
||||||
|
4. `sudo nginx -t && sudo systemctl reload nginx`
|
||||||
|
|
||||||
|
**第二步:ESA 控制台(不做则 noindex 再活 30 天)**
|
||||||
|
1. 全站 purge `wait4x.online`
|
||||||
|
2. HTML 边缘 TTL 调 ≤1h(当前 2592000s,靠回源重验证更新——头会固化)
|
||||||
|
3. 加规则:`/artalk/api/*` 绕过缓存(GET stats 有 Age 头实锤,pv 数字会冻)
|
||||||
|
|
||||||
|
**第三步:验证**
|
||||||
|
```bash
|
||||||
|
curl -sI https://wait4x.online/ | grep -ci x-robots-tag # 期望 0
|
||||||
|
curl -s https://wait4x.online/robots.txt | head -3 # 期望 User-agent + Sitemap
|
||||||
|
curl -sI https://wait4x.online/admin/ | grep -ci noindex # 期望 1(局部保留)
|
||||||
|
```
|
||||||
|
仓库侧已就绪:public/robots.txt(本提交);生产 Lighthouse SEO≥95 复测随后入档。
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
# wait4x.online —— 搜索引擎指引(Phase 5f T1)
|
||||||
|
# 背景:上线期 nginx 共享 snippet 误注全站 noindex,本文件随 SEO 解封三件套落地
|
||||||
|
# (docs/上线检查单.md「SEO 解封操作单」;robots 曾长期 404)
|
||||||
|
User-agent: *
|
||||||
|
Allow: /
|
||||||
|
Disallow: /admin/
|
||||||
|
Disallow: /draft/
|
||||||
|
|
||||||
|
Sitemap: https://wait4x.online/sitemap-index.xml
|
||||||
Reference in new issue
Block a user