备案权重域名预定

 找回密碼
 加入我們

AI蜘蛛屏蔽

[複製鏈接]
老黑酱 發表於 2026-6-22 16:20:31 | 顯示全部樓層 |閱讀模式
寶塔 Nginx 配置(推薦,複製即用)
操作步驟
寶塔 → 網站 → 選你的站點
設置 → 配置文件
在 server { ... } 裏、所有 location 塊之前 粘貼下面代碼
保存 → 重載配置

  1. # ========== 屏蔽 AI / 数据采集爬虫 ==========
  2. set $block_ai_bot 0;

  3. if ($http_user_agent ~* "GPTBot")                          { set $block_ai_bot 1; }
  4. if ($http_user_agent ~* "ChatGPT-User")                     { set $block_ai_bot 1; }
  5. if ($http_user_agent ~* "OAI-SearchBot")                   { set $block_ai_bot 1; }
  6. if ($http_user_agent ~* "anthropic-ai")                     { set $block_ai_bot 1; }
  7. if ($http_user_agent ~* "ClaudeBot")                        { set $block_ai_bot 1; }
  8. if ($http_user_agent ~* "claude-web")                        { set $block_ai_bot 1; }
  9. if ($http_user_agent ~* "Google-Extended")                  { set $block_ai_bot 1; }
  10. if ($http_user_agent ~* "Applebot-Extended")                { set $block_ai_bot 1; }
  11. if ($http_user_agent ~* "Bytespider")                        { set $block_ai_bot 1; }
  12. if ($http_user_agent ~* "CCBot")                            { set $block_ai_bot 1; }
  13. if ($http_user_agent ~* "Amazonbot")                         { set $block_ai_bot 1; }
  14. if ($http_user_agent ~* "FacebookBot")                       { set $block_ai_bot 1; }
  15. if ($http_user_agent ~* "meta-externalagent")                { set $block_ai_bot 1; }
  16. if ($http_user_agent ~* "meta-externalfetcher")              { set $block_ai_bot 1; }
  17. if ($http_user_agent ~* "cohere-ai")                         { set $block_ai_bot 1; }
  18. if ($http_user_agent ~* "Diffbot")                           { set $block_ai_bot 1; }
  19. if ($http_user_agent ~* "ImagesiftBot")                      { set $block_ai_bot 1; }
  20. if ($http_user_agent ~* "Omgilibot")                         { set $block_ai_bot 1; }
  21. if ($http_user_agent ~* "Omgili")                            { set $block_ai_bot 1; }
  22. if ($http_user_agent ~* "PerplexityBot")                     { set $block_ai_bot 1; }
  23. if ($http_user_agent ~* "YouBot")                            { set $block_ai_bot 1; }
  24. if ($http_user_agent ~* "AI2Bot")                            { set $block_ai_bot 1; }
  25. if ($http_user_agent ~* "PetalBot")                           { set $block_ai_bot 1; }
  26. if ($http_user_agent ~* "DataForSeoBot")                      { set $block_ai_bot 1; }
  27. if ($http_user_agent ~* "magpie-crawler")                     { set $block_ai_bot 1; }
  28. if ($http_user_agent ~* "img2dataset")                         { set $block_ai_bot 1; }
  29. if ($http_user_agent ~* "Scrapy")                            { set $block_ai_bot 1; }
  30. if ($http_user_agent ~* "python-requests")                     { set $block_ai_bot 1; }
  31. if ($http_user_agent ~* "curl/")                              { set $block_ai_bot 1; }
  32. if ($http_user_agent ~* "wget")                               { set $block_ai_bot 1; }
  33. if ($http_user_agent ~* "HttpClient")                         { set $block_ai_bot 1; }
  34. if ($http_user_agent ~* "Java/")                              { set $block_ai_bot 1; }
  35. if ($http_user_agent ~* "Go-http-client")                    { set $block_ai_bot 1; }

  36. if ($block_ai_bot = 1) {
  37.     return 403;
  38. }
  39. # ========== 屏蔽结束 ==========
複製代碼


回復

使用道具 舉報

您需要登錄後才可以回帖 登錄 | 加入我們

本版積分規則

备案权重域名预定

點基

GMT+8, 2026-7-5 15:03

By DZ X3.5

QQ

快速回復 返回頂部 返回列表