7. Transports and Clients

httpClientConfig

Version

Settings the HTTP client uses for calls to a backend: socket timeouts, an upstream proxy, credentials, TLS and retry behavior. Every part is optional and falls back to its defaults when omitted. Configure it once globally, or on a single plugin that calls a backend.

Example Configuration

configuration:
httpClientConfig:
connection:
timeout: 5000
proxy:
host: proxy.example.com
port: 3128
retries:
retries: 3
configuration:
   httpClientConfig:
     connection:
       timeout: 5000
     proxy:
       host: proxy.example.com
       port: 3128
     retries:
       retries: 3

Syntax

httpClientConfig:
'$ref': <string>
adjustHostHeader: <boolean>
authentication: {}
connection: {}
proxy: {}
retries: {}
ssl: {}
useExperimentalHttp2: <boolean>
httpClientConfig:
  '$ref': <string>
  adjustHostHeader: <boolean>
  authentication: {}
  connection: {}
  proxy: {}
  retries: {}
  ssl: {}
  useExperimentalHttp2: <boolean>

Attributes

NameRequiredDefaultDescriptionExamples
$reffalse-Reference a component defined under components.-
adjustHostHeaderfalsetrueRewrites the Host header to the address of the backend. Set to false to forward the Host header the client sent, e.g. when the backend serves virtual hosts under that name.false
useExperimentalHttp2falsefalseNegotiates HTTP/2 over TLS when the backend offers it and falls back to HTTP/1.1 otherwise. Experimental.true

Child Structure

ElementCardinalityDescription
authentication0..1Credentials sent as HTTP Basic Authentication with every outgoing request.
connection0..1Socket timeouts and the local network interface used for outgoing connections.
proxy0..1Upstream HTTP proxy that outgoing requests are routed through.
retries0..1Retries a request to the backend when the connection fails or the server answers with a status code that is worth another attempt. The initial call is followed by a configurable number of further attempts.
ssl0..1Configures inbound or outbound SSL connections.

Can be used in