mirror of
https://github.com/caddyserver/caddy.git
synced 2025-08-07 09:04:04 -04:00
Add global config docs
parent
14fdbecfac
commit
041c48e430
@ -30,6 +30,7 @@ Features which are available in Caddy Enterprise are indicated with 🏢
|
||||
- [Caddyfile adapter](#caddyfile-adapter)
|
||||
- [Matcher tokens](#matcher-tokens)
|
||||
- [Shorthand placeholders](#shorthand-placeholders)
|
||||
- [Global config](#global-config)
|
||||
- [Caddyfile directives](#caddyfile-directives)
|
||||
- [root](#root)
|
||||
- [matcher](#matcher)
|
||||
@ -430,6 +431,20 @@ The Caddyfile is supposed to be easy to write, so it also provides shorter place
|
||||
| {query} | {http.request.uri.query} |
|
||||
|
||||
|
||||
#### Global config
|
||||
|
||||
The Caddyfile has a special place for specific settings that apply to the whole process rather than specifically per-site. This allows us to replace an arbitrary and growing number of CLI flags and environment variables, which constituted a large portion of hidden configuration in version 1.
|
||||
|
||||
Simply create a server block with no keys to specify such global options. The following options are allowed:
|
||||
|
||||
```
|
||||
{
|
||||
http_port <port>
|
||||
https_port <port>
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
#### Caddyfile directives
|
||||
|
||||
##### root
|
||||
@ -565,7 +580,7 @@ tls [off|<cert> <key>] {
|
||||
Rewrites a request based on the existence of the listed files on disk. Because this is a fairly common rewrite, this directive simply combines a `rewrite` handler with a `file` matcher for convenience in writing.
|
||||
|
||||
```
|
||||
try_files [<files...>]
|
||||
try_files <files...>
|
||||
```
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user