Open Source API Gateway
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>
info: {}
ip: <string>
name: <string>
path: {}
port: <int>
ssl: {}
tags:
- <string>
target: {}
internal:
  '$ref': <string>
  flow:
    - <flow>
  host: <string>
  info: {}
  ip: <string>
  name: <string>
  path: {}
  port: <int>
  ssl: {}
  tags:
    - <string>
  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, openapi, etc.The name of the proxy or API.-
portfalse80The port Membrane listens on for incoming connections.8080
tagsfalse---

Child Structure

ElementCardinalityDescription
flow0..*
info0..1Metadata about the API that API catalogs publish, such as whom to contact. It takes precedence over the same metadata in an OpenAPI document of the API.
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 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.
target0..1The backend server that requests are forwarded to after passing through the flow.

Can be used in

No parent elements.