mirror of
https://github.com/caddyserver/website.git
synced 2025-04-25 06:26:17 -04:00
Updated for v2.8.0 (#389)
Co-authored-by: Mohammed Al Sahaf <msaa1990@gmail.com> Co-authored-by: Francis Lavoie <lavofr@gmail.com> Co-authored-by: Nebez Briefkani <me@nebezb.com> Co-authored-by: Mohammed Al Sahaf <mohammed@caffeinatedwonders.com>
This commit is contained in:
parent
1a82466537
commit
ca9ce7b2b5
22 changed files with 549 additions and 107 deletions
|
@ -23,6 +23,8 @@ rewrite [<matcher>] <to>
|
|||
|
||||
- **<to>** is the URI to rewrite the request to. Only the components of the URI (path or query string) that are specified in the rewrite will be operated on. The URI path is any substring that comes before `?`. If `?` is omitted, then the whole token is considered to be the path.
|
||||
|
||||
Prior to v2.8.0, the `<to>` argument could be confused by the parser for a [matcher token](/docs/caddyfile/matchers#syntax) if it began with `/`, so it was necessary to specify a wildcard matcher token (`*`).
|
||||
|
||||
|
||||
## Similar directives
|
||||
|
||||
|
@ -44,6 +46,12 @@ example.com {
|
|||
}
|
||||
```
|
||||
|
||||
<aside class="tip">
|
||||
|
||||
Note that prior to v2.8.0, a [wildcard matcher](/docs/caddyfile/matchers#wildcard-matchers) was required here because the first argument is ambiguous with a [path matcher](/docs/caddyfile/matchers#path-matchers), i.e. `rewrite * /foo`, but it can now be simplified to `rewrite /foo`.
|
||||
|
||||
</aside>
|
||||
|
||||
Prefixing all requests with `/api`, preserving the rest of the URI, then reverse proxying to an app:
|
||||
|
||||
```caddy
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue