Skip to content

Commit

Permalink
Block AI crawlers via Caddy robots.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
Celeo committed Feb 8, 2025
1 parent 80e4b3b commit b7121f0
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions ops/Caddyfile-live
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,60 @@ example.com {
file_server
}

@robots {
method GET
path_regexp ^/robots\.txt$
}

handle @robots {
respond "User-agent: AI2Bot
User-agent: Ai2Bot-Dolma
User-agent: Amazonbot
User-agent: anthropic-ai
User-agent: Applebot
User-agent: Applebot-Extended
User-agent: Bytespider
User-agent: CCBot
User-agent: ChatGPT-User
User-agent: Claude-Web
User-agent: ClaudeBot
User-agent: cohere-ai
User-agent: cohere-training-data-crawler
User-agent: Crawlspace
User-agent: Diffbot
User-agent: DuckAssistBot
User-agent: FacebookBot
User-agent: FriendlyCrawler
User-agent: Google-Extended
User-agent: GoogleOther
User-agent: GoogleOther-Image
User-agent: GoogleOther-Video
User-agent: GPTBot
User-agent: iaskspider/2.0
User-agent: ICC-Crawler
User-agent: ImagesiftBot
User-agent: img2dataset
User-agent: ISSCyberRiskCrawler
User-agent: Kangaroo Bot
User-agent: Meta-ExternalAgent
User-agent: Meta-ExternalFetcher
User-agent: OAI-SearchBot
User-agent: omgili
User-agent: omgilibot
User-agent: PanguBot
User-agent: PerplexityBot
User-agent: PetalBot
User-agent: Scrapy
User-agent: SemrushBot-OCOB
User-agent: SemrushBot-SWA
User-agent: Sidetrade indexer bot
User-agent: Timpibot
User-agent: VelenPublicWebCrawler
User-agent: Webzio-Extended
User-agent: YouBot
Disallow: /"
}

handle {
reverse_proxy :5001
}
Expand Down

0 comments on commit b7121f0

Please sign in to comment.