target

Version

Defines the backend a proxy forwards messages to, given either as a host with a port or as a full url. The destination can be computed per request with inline ${expression} templates; outbound TLS and an overriding HTTP method can also be configured here.

Example Configuration

target:
url: https://api.predic8.de
target:
   url: https://api.predic8.de

Syntax

target:
'$ref': <string>
adjustHostHeader: <boolean>
escaping: json
host: <string>
language: groovy
method: <string>
port: <number>
ssl: {}
url: <string>
xmlConfig: {}
target:
  '$ref': <string>
  adjustHostHeader: <boolean>
  escaping: json
  host: <string>
  language: groovy
  method: <string>
  port: <number>
  ssl: {}
  url: <string>
  xmlConfig: {}

Attributes

NameRequiredDefaultDescriptionExamples
$reffalse-Reference a component defined under components.-
adjustHostHeaderfalsetrueRewrites the outgoing Host header to the target host. Disable to forward the client's original Host header unchanged.false
escapingfalseURLHow values computed from ${...} templates are escaped before being inserted into the URL, to prevent injection. URL escapes a whole URL, SEGMENT a single path segment, NONE disables escaping.SEGMENT
hostfalse-Host name or IP address of the target. Ignored when url is set.localhost
languagefalseSpELExpression language used to evaluate inline ${...} templates in the URL.groovy
methodfalse-Overrides the HTTP method used for the backend call, replacing the method of the incoming request. When not set, the original method is kept.POST
portfalse80, or 443 when the target uses TLSPort number of the target. Ignored when url is set.8080
urlfalse-Absolute URL of the target. When set, host and port are ignored. Supports inline ${<expression>} templates. If the URL contains a path, that path replaces the request path; usually the request path should be kept, so give a URL without a path such as https://api.predic8.de.https://api.predic8.de

Child Structure

ElementCardinalityDescription
ssl0..1Configures inbound or outbound SSL connections.
xmlConfig0..1

Can be used in