mirror of
https://github.com/caddyserver/website.git
synced 2025-04-24 14:06:17 -04:00
docs: Add Caddyfile syntax highlighting (#41)
This commit is contained in:
parent
75fcfc21bb
commit
e0f5ee1bb9
34 changed files with 215 additions and 179 deletions
|
@ -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}
|
||||
```
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue