Improve matcher syntax docs, augment handle_path docs

This commit is contained in:
Francis Lavoie 2023-10-06 01:49:45 -04:00
parent dfd52789d9
commit 6400747447
No known key found for this signature in database
GPG key ID: 0F66EE1687682239
2 changed files with 25 additions and 7 deletions

View file

@ -58,11 +58,11 @@ window.$(function() {
In the Caddyfile, a **matcher token** immediately following the directive can limit that directive's scope. The matcher token can be one of these forms:
1. **`*`** to match all requests (wildcard; default).
2. **`/path`** start with a forward slash to match a request path.
3. **`@name`** to specify a _named matcher_.
1. [**`*`**](#wildcard-matchers) to match all requests (wildcard; default).
2. [**`/path`**](#path-matchers) start with a forward slash to match a request path.
3. [**`@name`**](#named-matchers) to specify a _named matcher_.
Matcher tokens are [usually optional](/docs/caddyfile/directives#matchers). If a matcher token is omitted, it is the same as a wildcard matcher (`*`).
If a directive supports matchers, it will appear as `[<matcher>]` in its syntax documentation. Matcher tokens are [usually optional](/docs/caddyfile/directives#syntax), denoted by `[ ]`. If the matcher token is omitted, it is the same as a wildcard matcher (`*`).
#### Examples
@ -173,6 +173,8 @@ A named matcher definition constitutes a _matcher set_. Matchers in a set are AN
Multiple matchers of the same type may be unioned (e.g. multiple `path` matchers in the same set) using boolean algebra (AND/OR), as described in their respective sections below.
For more complex boolean matching logic, it's recommended to the [`expression` matcher](#expression) to write a CEL expression, which supports _and_ `&&`, _or_ `||`, and _parentheses_ `( )`.