From 82fe6a21a8bc3ef8952320e4e8e0c29720978d66 Mon Sep 17 00:00:00 2001 From: Vladimir Plizga Date: Thu, 7 Oct 2021 06:34:20 +0700 Subject: [PATCH] Move RemoteAddressResolvers doc paragraph (#2272) close to RemoteAddr predicate description Co-authored-by: Vladimir Plizga --- .../main/asciidoc/spring-cloud-gateway.adoc | 52 +++++++++---------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/docs/src/main/asciidoc/spring-cloud-gateway.adoc b/docs/src/main/asciidoc/spring-cloud-gateway.adoc index d406065d..6650e8f4 100644 --- a/docs/src/main/asciidoc/spring-cloud-gateway.adoc +++ b/docs/src/main/asciidoc/spring-cloud-gateway.adoc @@ -367,32 +367,6 @@ spring: This route matches if the remote address of the request was, for example, `192.168.1.10`. -=== The Weight Route Predicate Factory - -The `Weight` route predicate factory takes two arguments: `group` and `weight` (an int). The weights are calculated per group. -The following example configures a weight route predicate: - -.application.yml -==== -[source,yaml] ----- -spring: - cloud: - gateway: - routes: - - id: weight_high - uri: https://weighthigh.org - predicates: - - Weight=group1, 8 - - id: weight_low - uri: https://weightlow.org - predicates: - - Weight=group1, 2 ----- -==== - -This route would forward ~80% of traffic to https://weighthigh.org and ~20% of traffic to https://weighlow.org - ==== Modifying the Way Remote Addresses Are Resolved By default, the RemoteAddr route predicate factory uses the remote address from the incoming request. @@ -453,6 +427,32 @@ RemoteAddressResolver resolver = XForwardedRemoteAddressResolver ---- ==== +=== The Weight Route Predicate Factory + +The `Weight` route predicate factory takes two arguments: `group` and `weight` (an int). The weights are calculated per group. +The following example configures a weight route predicate: + +.application.yml +==== +[source,yaml] +---- +spring: + cloud: + gateway: + routes: + - id: weight_high + uri: https://weighthigh.org + predicates: + - Weight=group1, 8 + - id: weight_low + uri: https://weightlow.org + predicates: + - Weight=group1, 2 +---- +==== + +This route would forward ~80% of traffic to https://weighthigh.org and ~20% of traffic to https://weighlow.org + == `GatewayFilter` Factories Route filters allow the modification of the incoming HTTP request or outgoing HTTP response in some manner.