This commit is contained in:
David Baynard 2025-03-10 10:43:53 +00:00 committed by GitHub
commit d6144aa57b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -487,6 +487,8 @@ reverse_proxy https://example.com {
The `X-Forwarded-Host` header is still passed [by default](#defaults), so the upstream may still use that if it needs to know the original `Host` header value.
The same applies when terminating TLS in caddy and proxying via HTTP, whether to a port or a unix socket. Indeed, caddy itself must receive the correct Host, when it is the target of `reverse_proxy`. In the unix socket case, the `upstream_hostport` will be the socket path, and the Host must be set explicitly.
## Rewrites
@ -686,6 +688,7 @@ Three placeholders will be made available within the `handle_response` routes:
- `{rp.header.*}` The headers from the backend's response.
While the reverse proxy response handler can copy the new response received from the proxy back to the client, it cannot pass on that new response to a subsequent reverse proxy. Every use of `reverse_proxy` receives the body from the original request (or as modified with a different module).