From ddfb116cfc377c6096276be4f6f20dfbcec34eb8 Mon Sep 17 00:00:00 2001 From: Simon Legner Date: Thu, 6 Jun 2024 00:29:31 +0200 Subject: [PATCH] docs: use vars inside templates (#396) Co-authored-by: Francis Lavoie --- src/docs/markdown/caddyfile/directives/vars.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/docs/markdown/caddyfile/directives/vars.md b/src/docs/markdown/caddyfile/directives/vars.md index 36f8af9..2497c2c 100644 --- a/src/docs/markdown/caddyfile/directives/vars.md +++ b/src/docs/markdown/caddyfile/directives/vars.md @@ -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. -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. +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.