docs: Update reverse_proxy examples

This commit is contained in:
Francis Lavoie 2020-12-02 12:47:17 -05:00
parent e2a6e4e212
commit d406814cfb
No known key found for this signature in database
GPG key ID: 4EE5207CCECBACD7

View file

@ -243,11 +243,22 @@ Reverse proxy to an HTTPS endpoint:
reverse_proxy https://example.com
```
Strip a path prefix then proxy:
Configure some transport options:
```caddy-d
route /prefix/* {
uri strip_prefix /prefix
reverse_proxy https://example.com {
transport http {
dial_timeout 2s
tls_timeout 2s
}
}
```
Strip a path prefix then proxy with a new path:
```caddy-d
handle_path /prefix/* {
rewrite * /foo{path}
reverse_proxy localhost:9000
}
```