From bf49d812199d037fb3ce460f0e6fd516ddfb474c Mon Sep 17 00:00:00 2001 From: Mikko Karjalainen Date: Tue, 21 May 2019 08:18:39 +0100 Subject: [PATCH] Fix advanced routing config document. --- docs/user-guide/configure-advanced-routing.md | 102 +++++------------- 1 file changed, 25 insertions(+), 77 deletions(-) diff --git a/docs/user-guide/configure-advanced-routing.md b/docs/user-guide/configure-advanced-routing.md index 9ccb980170..a84823e6b8 100644 --- a/docs/user-guide/configure-advanced-routing.md +++ b/docs/user-guide/configure-advanced-routing.md @@ -31,83 +31,33 @@ backends. - bad-cookie-fixer handler: name: protocol-router - destination: protocolCheck - - ----- - - routingObjects: - proxyToSecure: - type: BackendServiceProxy - config: - backendProvider: "https-backends" - - proxyToInsecure: - type: BackendServiceProxy - config: - backendProvider: "http-backends" - - - proxyToEdgeAuthSrv: - type: BackendServiceProxy - config: - .. - connectionPool: - ... - tlsSettings: - ... - healthCheck: - ... - - proxyToErrorLoggingService: - type: BackendServiceProxy - config: - .. - connectionPool: - ... - tlsSettings: - ... - healthCheck: - ... - - pathPrefixForSecureApps: - type: PathPrefix - config: - - pathPrefixForInsecureApps: - type: PathPrefix - config: - - protocolCheck: type: ConditionRouter config: - choice: + routes: - condition: protocol() == "https" - destination: pathPrefixForSecureApps - default: - destination: proxyToErrorLoggingService - - trySecureFirst: - type: Duplicate - config: - copyTo: errorLogger - next: protocolCheck - + destination: + name: secure-backends + type: BackendServiceProxy + config: + backendProvider: "https-backends" + fallback: + name: insecure-backends + type: BackendServiceProxy + config: + backendProvider: "http-backends" -Without going too much into details (specifics will be explained later) -a hierarchical structure should be apparent. The pipeline itself is an -*InterceptorPipeline* object which runs the traffic through a pipeline of -two interceptors, in this case plugins: +The forwarding pipeline in this example is an *InterceptorPipeline* object +which runs the traffic through a pipeline of two interceptor plugins: - *redirect-old-domain* - *bad-cookie-fixer* before -After this pipeline, the traffic is handled by a *ConditionRouter* which -sends all traffic satisfying the condition *protocol() == "https" to a -BackendServiceProxy called *secure-backends*, and all the other traffic to -another BackendServiceProxy called *insecure-backends*. +Finally the traffic reaches a *ConditionRouter* object which +sends all https traffic to a BackendServiceProxy called *secure-backends*, +and everything else to *insecure-backends*. -Graphically the object model can be represented as: +Here is a graphical representation: entrypoint @@ -120,7 +70,7 @@ Graphically the object model can be represented as: protocol-router | | - | +------------------+ + | \------------------\ | | | | v v @@ -193,17 +143,15 @@ the next handler in the processing chain. type: InterceptorPipeline config: pipeline: - + handler: - + *Pipeline*: -Routing config node list can have both routing config references and -definitions mixed together. A routing config reference must always -refer to a valid plugin name that has been declared in the Styx *plugins* -section. A routing config definition can be used to insert styx built-in -interceptors. +A list of strings. Each string must be a valid plugin name that has been +declared in the Styx *plugins* section. A routing config definition can +be used to insert styx built-in interceptors. *Handler*: @@ -223,7 +171,7 @@ which handler to pass the request to next. routes: fallback: - + *Routes*: @@ -232,7 +180,7 @@ This block contains a list of destinations that are activated depending on the o CONDITION-DESTINATION: condition: destination: - + Conditions are evaluated in the order in which they appear in the routes list. The request is sent to the first destination that results in a positive