From 041c48e430c4ac853f655d1c3cd0f5157cd052bf Mon Sep 17 00:00:00 2001 From: Matt Holt Date: Thu, 22 Aug 2019 13:44:21 -0600 Subject: [PATCH] Add global config docs --- v2:-Documentation.md | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/v2:-Documentation.md b/v2:-Documentation.md index bf9495a..b7ffdb0 100644 --- a/v2:-Documentation.md +++ b/v2:-Documentation.md @@ -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 + https_port +} +``` + + #### Caddyfile directives ##### root @@ -565,7 +580,7 @@ tls [off| ] { 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 [] +try_files ```