---
title: "Caddy: block by user-agent — AI Crawler Index"
description: "A Caddy matcher plus respond directive. Caddy's header_regexp matcher is case-sensitive, so the pattern is written with an inline (?i) flag."
canonical: "https://www.pathwren.workers.dev/snippet/caddy.html"
url: "https://www.pathwren.workers.dev/snippet/caddy.md"
format: "markdown"
source: "the bytes of /snippet/caddy.html, in the build that wrote the page"
generator: "surfaces/ai-crawler-index/build.py"
generated: "2026-09-03T07:55:35+00:00"
license: "CC0-1.0"
---

# Caddy: block by user-agent

> A Caddy matcher plus respond directive. Caddy's header_regexp matcher is case-sensitive, so the pattern is written with an inline (?i) flag.

A Caddy matcher plus respond directive. Caddy's header_regexp matcher is case-sensitive, so the pattern is written with an inline (?i) flag.

```bash
curl -s https://www.pathwren.workers.dev/snippet/caddy.txt -o Caddyfile
```

```text
# AI Crawler Index — Caddy
# curl -s https://www.pathwren.workers.dev/snippet/caddy.txt
@ai_training header_regexp User-Agent "(?i)(GPTBot|ClaudeBot|anthropic\-ai|GoogleOther|Bytespider|TikTokSpider|meta\-externalagent|FacebookBot|cohere\-training\-data\-crawler|Webzio\-Extended|SemrushBot\-OCOB|GoogleOther\-Image|GoogleOther\-Video|YandexAdditional|YandexAdditionalBot|SBIntuitionsBot|ICC\-Crawler|Cotoyogi|ISSCyberRiskCrawler|Sidetrade\ indexer\ bot|QuillBot|Factset_spyderbot|Poseidon\ Research\ Crawler|Reflectionbot|Linguee\ Bot)"
@disputed    header_regexp User-Agent "(?i)(Bytespider|TikTokSpider|ISSCyberRiskCrawler|Thinkbot|Linguee\ Bot)"

handle @disputed {
	respond "403 - see /robots.txt" 403
}
handle @ai_training {
	header X-Crawler-Class "ai-training"
	# file_server / reverse_proxy as usual
}
```

[raw](https://www.pathwren.workers.dev/snippet/caddy.txt) · [json](https://www.pathwren.workers.dev/snippet/caddy.json)

## Sitemap

- [Full sitemap (XML)](https://www.pathwren.workers.dev/sitemap.xml) — every page, with dates
- [Full sitemap (markdown)](https://www.pathwren.workers.dev/sitemap.md) — the same map, readable
- [llms.txt](https://www.pathwren.workers.dev/llms.txt) — the whole host in one text file
- [documents.json](https://www.pathwren.workers.dev/documents.json) — every document, with its ETag
- [A2A agents](https://www.pathwren.workers.dev/a2a.html)
- [About and method](https://www.pathwren.workers.dev/about.html)
- [API](https://www.pathwren.workers.dev/api.html)
- [Changelog](https://www.pathwren.workers.dev/changelog.html)
- [Compliance](https://www.pathwren.workers.dev/compliance)
- [Contact](https://www.pathwren.workers.dev/contact)
- [Impressum · Anbieterkennzeichnung](https://www.pathwren.workers.dev/impressum)
- [AI Crawler Index](https://www.pathwren.workers.dev/index.html)
- [No model runs here](https://www.pathwren.workers.dev/inference.html)
- [Legal](https://www.pathwren.workers.dev/legal)
- [MCP server](https://www.pathwren.workers.dev/mcp-doctor.html)
- [MCP server](https://www.pathwren.workers.dev/mcp-lint.html)
- [MCP server](https://www.pathwren.workers.dev/mcp-netcheck.html)
- [MCP server](https://www.pathwren.workers.dev/mcp-robots.html)
- [MCP transport: the GET and HEAD leg](https://www.pathwren.workers.dev/mcp-transport.html)
- [MCP server](https://www.pathwren.workers.dev/mcp-triage.html)
- [MCP server](https://www.pathwren.workers.dev/mcp.html)
- [Packages](https://www.pathwren.workers.dev/packages.html)
- [Pricing](https://www.pathwren.workers.dev/pricing)
- [Privacy](https://www.pathwren.workers.dev/privacy.html)
- [API reference](https://www.pathwren.workers.dev/reference)
- [Access, keys and sign-up](https://www.pathwren.workers.dev/register)
- [Security posture](https://www.pathwren.workers.dev/security.html)
- [Upstream status](https://www.pathwren.workers.dev/status.html)
- [Terms of use](https://www.pathwren.workers.dev/terms.html)
- [Trust](https://www.pathwren.workers.dev/trust)

## Machine copies of this page

- [HTML (canonical)](https://www.pathwren.workers.dev/snippet/caddy.html)
- [JSON](https://www.pathwren.workers.dev/snippet/caddy.json)
- [Markdown](https://www.pathwren.workers.dev/snippet/caddy.md) — this document

This document is a markdown rendering of [https://www.pathwren.workers.dev/snippet/caddy.html](https://www.pathwren.workers.dev/snippet/caddy.html), generated from that page's own bytes in the same build. The HTML page is canonical.
