From 67ceb0bdc67126f64d4282d1aaf351a7d57a1352 Mon Sep 17 00:00:00 2001 From: Marco Bernasocchi Date: Thu, 13 Feb 2020 21:54:17 +0100 Subject: [PATCH] add matcher example with capture groups --- src/docs/markdown/caddyfile/concepts.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/docs/markdown/caddyfile/concepts.md b/src/docs/markdown/caddyfile/concepts.md index 767d489..f16d690 100644 --- a/src/docs/markdown/caddyfile/concepts.md +++ b/src/docs/markdown/caddyfile/concepts.md @@ -273,6 +273,15 @@ To match on anything other than a path, define a **named matcher** and refer to reverse_proxy @post localhost:9000 ``` +To match using capture groups use a named matcher: + +``` +@ows { + path_regexp map_file ^/ows/(.*) +} + +redir @ows /index.html?{query}&map=/io/data/{http.regexp.map_file.1}.qgs +``` ## Placeholders @@ -356,4 +365,4 @@ If present, it must be the very first block in the config. It is used to set options that apply globally, or not to any one site in particular. Inside, only global options can be set; you cannot use regular site directives in them. -[Learn more](/docs/caddyfile/options) about the global options block. \ No newline at end of file +[Learn more](/docs/caddyfile/options) about the global options block.