1. Proxies and Flow

internal

Version

A named API that is not exposed on any port and can only be invoked by other APIs within the gateway using the internal://name URL scheme. Use it to factor out shared flow logic that multiple APIs call.

Example Configuration

internal:
name: shared-auth
flow:
- setHeader:
name: X-Api-Key
value: downstream-secret
target:
url: https://api.example.com

---
api:
port: 2000
target:
url: internal://shared-auth

---
api:
port: 3000
target:
url: internal://shared-auth
internal:
   name: shared-auth
   flow:
     - setHeader:
         name: X-Api-Key
         value: downstream-secret
   target:
     url: https://api.example.com

 ---
 api:
   port: 2000
   target:
     url: internal://shared-auth

 ---
 api:
   port: 3000
   target:
     url: internal://shared-auth

Syntax

internal:
'$ref': <string>
flow:
- <flow>
host: <string>
ip: <string>
name: <string>
path: {}
port: <number>
ssl: {}
target: {}
internal:
  '$ref': <string>
  flow:
    - <flow>
  host: <string>
  ip: <string>
  name: <string>
  path: {}
  port: <number>
  ssl: {}
  target: {}

Attributes

NameRequiredDefaultDescriptionExamples
$reffalse-Reference a component defined under components.-
hostfalsenot setRestricts to requests whose Host header matches one of the given hostnames. Separate multiple hostnames with spaces. The asterisk * matches any number of characters, including zero, for basic globbing.predic8.de *.predic8.de
ipfalsenot setIf present, binds the port only on the specified IP. Useful for hosts with multiple IP addresses.127.0.0.1
namefalseBy default, a name will be automatically generated from the target host, port, etc.The name as shown in the Admin Console.-
portfalse80The port Membrane listens on for incoming connections.8080

Child Structure

ElementCardinalityDescription
flow0..*
path0..1Restricts to requests whose path matches, either by prefix (starts-with) or, when enabled, by regular expression. In a soapProxy, setting a path also rewrites the paths of SOAP requests and the service addresses in the WSDL accordingly.
ssl0..1Configures inbound or outbound SSL connections.
target0..1The backend server that requests are forwarded to after passing through the flow.

Can be used in

No parent elements.