mirror of
https://github.com/caddyserver/website.git
synced 2025-05-06 19:57:13 -04:00
Added documentation for snippet arguments
Added documentation, the only resource available for this feature, a post on the forum and the PR : https://github.com/caddyserver/caddy/pull/3423
This commit is contained in:
parent
a223b5ed55
commit
47b97b8262
1 changed files with 21 additions and 0 deletions
|
@ -276,6 +276,27 @@ import redirect
|
|||
|
||||
The [`import`](/docs/caddyfile/directives/import) directive can also be used to include other files in its place. As a special case, it can appear almost anywhere within the Caddyfile.
|
||||
|
||||
The [`import`](/docs/caddyfile/directives/import) directive supports the arguments :
|
||||
|
||||
```caddy
|
||||
(log_common) {
|
||||
log {
|
||||
output file /var/log/caddy/{args.0}.access.log
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
And then you can reuse it anywhere with parameters:
|
||||
|
||||
```caddy-d
|
||||
a.example.com {
|
||||
import log_common a.example.com
|
||||
}
|
||||
|
||||
b.example.com {
|
||||
import log_common b.example.com
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
## Comments
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue