docs: Add Caddyfile syntax highlighting (#41)

This commit is contained in:
Francis Lavoie 2020-05-17 16:32:12 -04:00 committed by GitHub
parent 75fcfc21bb
commit e0f5ee1bb9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
34 changed files with 215 additions and 179 deletions

View file

@ -13,7 +13,7 @@ Because `rewrite` essentially performs an internal redirect, the Caddyfile adapt
## Syntax
```
```caddy-d
rewrite [<matcher>] <to>
```
@ -24,25 +24,25 @@ rewrite [<matcher>] <to>
Rewrite all requests to `foo.html`, leaving any query string unchanged:
```
```caddy-d
rewrite * /foo.html
```
Replace the query string on API requests with `a=b`, leaving the path unchanged:
```
```caddy-d
rewrite /api/* ?a=b
```
Preserve the existing query string and add a key-value pair:
```
```caddy-d
rewrite /api/* ?{query}&a=b
```
Change both the path and query string, preserving the original query string while adding the original path as the `p` parameter:
```
```caddy-d
rewrite * /index.php?{query}&p={path}
```