docs: Update reverse_proxy examples (#119)

Co-authored-by: Matt Holt <mholt@users.noreply.github.com>
This commit is contained in:
Francis Lavoie 2020-12-02 13:38:23 -05:00 committed by GitHub
parent e2a6e4e212
commit a05f559c12
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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
}
}
```
Replace a path prefix before proxying:
```caddy-d
handle_path /old-prefix/* {
rewrite * /new-prefix{path}
reverse_proxy localhost:9000
}
```