mirror of
https://github.com/caddyserver/website.git
synced 2025-04-22 04:56:17 -04:00
docs: Update reverse_proxy examples (#119)
Co-authored-by: Matt Holt <mholt@users.noreply.github.com>
This commit is contained in:
parent
e2a6e4e212
commit
a05f559c12
1 changed files with 14 additions and 3 deletions
|
@ -243,11 +243,22 @@ Reverse proxy to an HTTPS endpoint:
|
||||||
reverse_proxy https://example.com
|
reverse_proxy https://example.com
|
||||||
```
|
```
|
||||||
|
|
||||||
Strip a path prefix then proxy:
|
Configure some transport options:
|
||||||
|
|
||||||
```caddy-d
|
```caddy-d
|
||||||
route /prefix/* {
|
reverse_proxy https://example.com {
|
||||||
uri strip_prefix /prefix
|
transport http {
|
||||||
|
dial_timeout 2s
|
||||||
|
tls_timeout 2s
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Replace a path prefix before proxying:
|
||||||
|
|
||||||
|
```caddy-d
|
||||||
|
handle_path /old-prefix/* {
|
||||||
|
rewrite * /new-prefix{path}
|
||||||
reverse_proxy localhost:9000
|
reverse_proxy localhost:9000
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue