mirror of
https://github.com/caddyserver/website.git
synced 2025-04-22 13:06:16 -04:00
docs: A few minor changes
This commit is contained in:
parent
db18a5d4c8
commit
9daa0fa331
3 changed files with 18 additions and 3 deletions
|
@ -11,7 +11,7 @@ When enabled, requests matching the path `/acme/*` will be handled by the ACME s
|
|||
|
||||
## Client configuration
|
||||
|
||||
Using ACME server defaults, ACME clients should simply be configured to use `https://localhost/acme/directory` as their ACME endpoint.
|
||||
Using ACME server defaults, ACME clients should simply be configured to use `https://localhost/acme/local/directory` as their ACME endpoint. (`local` is the name of Caddy's default CA.)
|
||||
|
||||
|
||||
## Syntax
|
||||
|
|
|
@ -8,7 +8,7 @@ Enables HTTP Basic Authentication, which can be used to protect directories and
|
|||
|
||||
**Note that basic auth is not secure over plain HTTP.** Use discretion when deciding what to protect with HTTP Basic Authentication.
|
||||
|
||||
When a user requests a resource that is protected, the browser will prompt the user for a username and password if they have not almdy supplied one. If the proper credentials are present in the Authorization header, the server will grant access to the resource. If the header is missing or the credentials are incorrect, the server will respond with HTTP 401 Unauthorized.
|
||||
When a user requests a resource that is protected, the browser will prompt the user for a username and password if they have not already supplied one. If the proper credentials are present in the Authorization header, the server will grant access to the resource. If the header is missing or the credentials are incorrect, the server will respond with HTTP 401 Unauthorized.
|
||||
|
||||
Caddy configuration does not accept plaintext passwords; you MUST hash them before putting them into the configuration. The [`caddy hash-password`](/docs/command-line#caddy-hash-password) command can help with this.
|
||||
|
||||
|
|
|
@ -11,10 +11,11 @@ This directive is a special case: it is evaluated before the structure is parsed
|
|||
## Syntax
|
||||
|
||||
```caddy-d
|
||||
import <pattern>
|
||||
import <pattern> [<args...>]
|
||||
```
|
||||
|
||||
- **<pattern>** is the filename, glob pattern, or name of [snippet](/docs/caddyfile/concepts#snippets) to include. Its contents will replace this line as if that file's contents appeared here to begin with. It is an error if a specific file cannot be found, but an empty glob pattern is not an error.
|
||||
- **<args...>** is an optional list of arguments to pass to the imported tokens. They can be used with a placeholder of the form `{args.N}` where `N` is the 0-based positional index of the parameter. This placeholder is a special case and is evaluated at parse-time, not run-time.
|
||||
|
||||
|
||||
## Examples
|
||||
|
@ -24,3 +25,17 @@ Import all files in an adjacent sites-enabled folder:
|
|||
```caddy-d
|
||||
import sites-enabled/*
|
||||
```
|
||||
|
||||
Import a snippet that sets CORS headers using an import argument:
|
||||
|
||||
```caddy
|
||||
(cors) {
|
||||
@origin header Origin {args.0}
|
||||
header @origin Access-Control-Allow-Origin "{args.0}"
|
||||
header @origin Access-Control-Request-Method GET
|
||||
}
|
||||
|
||||
example.com {
|
||||
import cors example.com
|
||||
}
|
||||
```
|
Loading…
Add table
Add a link
Reference in a new issue