docs: Add Caddyfile env var default value (#112)

This commit is contained in:
Francis Lavoie 2020-11-24 15:46:27 -05:00 committed by GitHub
parent 44c7994cb1
commit 970aadb620
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -298,6 +298,12 @@ If your configuration relies on environment variables, you can use them in the C
Environment variables in this form are substituted before parsing begins, so they can expand to empty values, partial tokens, complete tokens, or even multiple tokens and lines. Environment variables in this form are substituted before parsing begins, so they can expand to empty values, partial tokens, complete tokens, or even multiple tokens and lines.
A default value can be specified for when the environment variable is not found, by using `:` as the delimiter between the variable name and the default value:
```caddy
{$DOMAIN:localhost}
```
If you want to defer the substitution of an environment variable until runtime, you can use the [standard `{env.*}` placeholders](/docs/conventions#placeholders). If you want to defer the substitution of an environment variable until runtime, you can use the [standard `{env.*}` placeholders](/docs/conventions#placeholders).