mirror of
https://github.com/caddyserver/website.git
synced 2025-04-20 12:15:08 -04:00
Fix incorrect reverse proxy docs
This commit is contained in:
parent
618e4e559e
commit
42e351173b
2 changed files with 9 additions and 11 deletions
|
@ -71,11 +71,9 @@ reverse_proxy <upstreams...> {
|
||||||
# On a successful response, copy response headers
|
# On a successful response, copy response headers
|
||||||
@good status 2xx
|
@good status 2xx
|
||||||
handle_response @good {
|
handle_response @good {
|
||||||
request_header {
|
# for example, for each copy_headers field...
|
||||||
# for example, for each copy_headers field...
|
request_header Remote-User {http.reverse_proxy.header.Remote-User}
|
||||||
Remote-User {rp.header.Remote-User}
|
request_header Remote-Email {http.reverse_proxy.header.Remote-Email}
|
||||||
Remote-Email {rp.header.Remote-Email}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
|
@ -629,9 +629,9 @@ Additionally, inside `handle_response`, two special handler directives may be us
|
||||||
|
|
||||||
Three placeholders will be made available within the `handle_response` routes:
|
Three placeholders will be made available within the `handle_response` routes:
|
||||||
|
|
||||||
- `{rp.status_code}` The status code from the backend's response.
|
- `{http.reverse_proxy.status_code}` The status code from the backend's response.
|
||||||
- `{rp.status_text}` The status text from the backend's response.
|
- `{http.reverse_proxy.status_text}` The status text from the backend's response.
|
||||||
- `{rp.header.*}` The headers from the backend's response.
|
- `{http.reverse_proxy.header.*}` The headers from the backend's response.
|
||||||
|
|
||||||
|
|
||||||
#### Response matcher
|
#### Response matcher
|
||||||
|
@ -728,7 +728,7 @@ reverse_proxy localhost:8080 {
|
||||||
@accel header X-Accel-Redirect *
|
@accel header X-Accel-Redirect *
|
||||||
handle_response @accel {
|
handle_response @accel {
|
||||||
root * /path/to/private/files
|
root * /path/to/private/files
|
||||||
rewrite * {rp.header.X-Accel-Redirect}
|
rewrite * {http.reverse_proxy.header.X-Accel-Redirect}
|
||||||
method * GET
|
method * GET
|
||||||
file_server
|
file_server
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue