Overview
Thecustom responder allows you to return custom text messages with configurable HTTP status codes. This gives you full control over what blocked users see and how the response appears.
Configuration Options
| Option | Required | Default | Description |
|---|---|---|---|
message | Yes | - | The text message to return |
status_code | No | 200 | HTTP status code (e.g., 403, 404, 451) |
When to Use
Use thecustom responder when:
- You want to provide helpful error messages to users
- You need to use specific HTTP status codes
- You want to disguise blocked content (e.g., return 404 instead of 403)
- Legal compliance requires specific responses (e.g., HTTP 451 for geo-blocking)
Configuration Examples
- Caddyfile
- JSON
Example 1: Default 200 OK
Example 2: Custom 403 Status
Example 3: Stealth Mode with 404
Example 4: Legal Compliance with 451
Common Status Codes
The
message field is required when using the custom responder. If you don’t need a custom message, use the block responder instead.