http.request.uri.path — Last URI Segment
string
In the console: Last URI Segment
Carries the last segment of the path, not the full path: for a request to /admin/login its value is /login, for /api/v2/users it is /users. Use it to target a file or endpoint name regardless of which directory it lives in.
Supported Operators
Section titled “Supported Operators”| Operator | Description |
|---|---|
== | Exact match |
!= | Not equal |
in | In list |
not_in | Not in list |
contains | Contains |
not_contains | Does not contain |
has_prefix | Starts with |
has_not_prefix | Does not start with |
has_suffix | Ends with |
has_not_suffix | Does not end with |
Examples
Section titled “Examples”# Block PHP files in any directoryIF http.request.uri.path has_suffix .phpTHEN block# Rate limit login endpoints at every level (/login, /admin/login...)IF http.request.uri.path == /loginTHEN ratelimit 10/60s