Move RemoteAddressResolvers doc paragraph (#2272)

close to RemoteAddr predicate description

Co-authored-by: Vladimir Plizga <v.plizga@cft.ru>
This commit is contained in:
Vladimir Plizga
2021-10-07 06:34:20 +07:00
committed by GitHub
parent 123654e5c8
commit 82fe6a21a8

View File

@@ -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.