Open Source API Gateway
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 a TLS context: the identity (key and certificate) presented to the peer, the certificates trusted from it, and handshake parameters such as protocol, ciphers, and client-certificate policy. Attach it to a serviceProxy/api to terminate inbound TLS, or to a target to make an outbound connection over TLS; most attributes and child elements apply to both directions, but a few - such as clientAuth and useAsDefault - only take effect on an inbound context. See tutorials/ssl-tls/10-TLS-Termination.yaml for inbound termination and tutorials/ssl-tls/20-Central-SSL-Config.yaml for sharing one ssl across several APIs via $ref.

Can be used in