The preserve_host property
When proxying, Janus's default behavior is to set the upstream request's Host header to the hostname of the API's elected upstream from theupstreams.targets
property. The preserve_host
field accepts a boolean flag instructing Janus not to do so.
For example, when the preserve_host
property is not changed and an API is configured like this:
A possible request from a client to Janus could be:
Janus would extract the Host header value from the the hostname of the API's elected upstream from the upstreams.target
field, and would send the following request to your upstream service:
However, by explicitly configuring your API with preserve_host=true
:
And assuming the same request from the client:
Janus would preserve the Host on the client request and would send the following request to your upstream service:
Last updated
Was this helpful?