diff options
Diffstat (limited to 'caddyconfig')
-rw-r--r-- | caddyconfig/httpcaddyfile/directives.go | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/caddyconfig/httpcaddyfile/directives.go b/caddyconfig/httpcaddyfile/directives.go index ba8f438..4c2b2d9 100644 --- a/caddyconfig/httpcaddyfile/directives.go +++ b/caddyconfig/httpcaddyfile/directives.go @@ -27,14 +27,21 @@ import ( // directiveOrder specifies the order // to apply directives in HTTP routes. +// +// The root directive goes first in case rewrites or +// redirects depend on existence of files, i.e. the +// file matcher, which must know the root first. +// +// The header directive goes second so that headers +// can be manipulated before doing redirects. var directiveOrder = []string{ + "root", + "header", "redir", "rewrite", - "root", - // URI manipulation "uri", "try_files", |