Skip to content

Configuration Reference ​

This reference covers all configuration options available in RouteWarden.


Core Options ​

KeyTypeDefaultDescription
enabledbooltrueEnables or disables the middleware. When false, all traffic passes through.
enableDefaultPatternsbooltrueEnables built-in protection for .env*, .git, .aws, .sql, backups, and logs.
enableDefaultAllowPatternsbooltrueEnables built-in allowlist exemptions (/robots.txt, /sitemap.xml, /ads.txt, /security.txt, /.well-known/*). Set to false to disable.
pathPatterns[]string[]List of custom regular expressions to block (matches against normalized path).
blockPatterns[]string[]Alias for pathPatterns.
allowPatterns[]string[]Additional custom regex patterns to explicitly allow even if matching blocked rules.
allowedIps[]string[]Whitelisted IPv4/IPv6 addresses or CIDR subnets (e.g., 10.0.0.0/8, 127.0.0.1).
checkQueryboolfalseAlso inspects the URL raw query string for blocked patterns.
statusCodeint403Default HTTP status code when request is blocked (legacy shortcut).

Default Allow Patterns ​

By default, RouteWarden allows standard public informational files and ACME certificate verification paths:

regex
(?i)^/robots\.txt$
(?i)^/ads\.txt$
(?i)^/security\.txt$
(?i)^/\.well-known(/.*)?$

Response Configuration (response) ​

📖 Deep Dive: For an in-depth breakdown of all 11+ response behaviors, limitations, attacker impacts, and security cautions, visit the Response Modes Reference.

KeyTypeDefaultDescription
modestring"json"Response mode: json, html, text, xml, redirect, captcha, silentDrop, gzipBomb (bomb), tarpit, fakeSuccess (decoy), rateLimitChallenge (ratelimit), proxy (mirror), or infiniteStream (garbagestream).
statusCodeint403HTTP status code returned to client (use 200 for honeypots / deception, 429 for rate limit challenge).
bodystring""Response body for json, html, xml, or text mode.
headersmap[string]string{}Custom HTTP response headers injected into blocked responses.
redirectUrlstring""Target URL when mode: redirect.
proxyUrlstring""Target backend honeypot URL when mode: proxy (transparent reverse-proxy).
captchaobject{}Captcha challenge options when mode: captcha.
gzipBombMBint10Uncompressed stream size in Megabytes when mode: gzipBomb (expands ~1000x on client memory).
retryAfterSecondsint300Value for Retry-After header when mode: rateLimitChallenge.
tarpitDelayMsint1000Milliseconds between trickle bytes when mode: tarpit (stalls scanner connections).
tarpitMaxDurationSecondsint60Maximum seconds before terminating stalled connection in mode: tarpit.
streamSizeMBint50Total garbage data size in Megabytes when mode: infiniteStream.

Captcha Options (response.captcha) ​

KeyTypeDefaultDescription
providerstring"turnstile"Captcha provider: turnstile, hcaptcha, or recaptcha.
siteKeystring""Public site key for the captcha widget.
titlestring"Verification"Heading displayed on the verification challenge page.
templatestring""Optional custom HTML template string override.

Released under the MIT License.