Filters
This page is automatically synced from
docs-en/rules/filters.md. Language: English | 中文
Filters
Section titled “Filters”Filters narrow when a matched rule should execute, using method, header, IP, URL, or path/regex conditions.
example.com host://127.0.0.1:3000 includeFilter://m:GETexample.com host://127.0.0.1:3000 excludeFilter:///admin/Use include filters to require a condition and exclude filters to skip a condition.
⚠️ Several filter prefixes are inert at runtime in 0.0.96 (verified) — do not rely on them:
s:(status) andresH:(response header) are never evaluated:includeFilter://s:/includeFilter://resH:lock the rule to never apply (even when the status/header actually matches), andexcludeFilter://s:/excludeFilter://resH:never exclude. They run in the request phase where the response is not yet known.h:/reqH:only match standard request headers (e.g.User-Agent,Accept,Host).Content-Typeand custom headers (X-*) are not evaluated — verifiedh:Content-Type=jsonandh:X-Custom-Headerapply regardless of the actual request, whileh:User-Agent=curlworks.b:(body) does not filter. The documentedb:/regex/form is fail-closed on include (rule never matches) and never excludes; a bareb:foovalue is ignored.Working request-phase filters:
m:(method),i:(client IP),/pathand/regex/(path),h:/reqH:for standard headers, and host/URL filters. For status/body/response-header filtering usebifrost searchinstead.