add matcher example with capture groups

This commit is contained in:
Marco Bernasocchi 2020-02-13 21:54:17 +01:00 committed by GitHub
parent f74f5ade03
commit 67ceb0bdc6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -273,6 +273,15 @@ To match on anything other than a path, define a **named matcher** and refer to
reverse_proxy @post localhost:9000 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 ## 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. 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. [Learn more](/docs/caddyfile/options) about the global options block.