mirror of
https://github.com/caddyserver/website.git
synced 2025-04-20 12:15:08 -04:00
Update src/docs/markdown/caddyfile/directives/vars.md
This commit is contained in:
parent
c03841f370
commit
e93fa88fc1
1 changed files with 1 additions and 1 deletions
|
@ -6,7 +6,7 @@ title: vars (Caddyfile directive)
|
||||||
|
|
||||||
Sets one or more variables to a particular value, to be used later in the request handling chain.
|
Sets one or more variables to a particular value, to be used later in the request handling chain.
|
||||||
|
|
||||||
The primary way to access variables is with placeholders, which have the form `{vars.variable_name}`, or with the [`vars`](/docs/caddyfile/matchers#vars) and [`vars_regexp`](/docs/caddyfile/matchers#vars_regexp) request matchers. You may use variables with the [`templates`](/docs/caddyfile/directives/templates) directive, too: `{{placeholder "http.vars.variable_name"}}`
|
The primary way to access variables is with placeholders, which have the form `{vars.variable_name}`, or with the [`vars`](/docs/caddyfile/matchers#vars) and [`vars_regexp`](/docs/caddyfile/matchers#vars_regexp) request matchers. You may use variables with the [`templates`](templates) directive using the `placeholder` function, for example: `{{placeholder "http.vars.variable_name"}}`
|
||||||
|
|
||||||
As a special case, it's possible to override the variable named `http.auth.user.id`, which is stored in the replacer, to update the `user_id` field in access logs.
|
As a special case, it's possible to override the variable named `http.auth.user.id`, which is stored in the replacer, to update the `user_id` field in access logs.
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue