From 8dc1d0cbc363d2b69f6c837c2a8347869b789e0d Mon Sep 17 00:00:00 2001 From: buildmaster Date: Tue, 19 May 2020 20:21:58 +0000 Subject: [PATCH] Sync docs from master to gh-pages --- reference/html/index.html | 83 +++++++++++++++++------- reference/html/spring-cloud-gateway.html | 83 +++++++++++++++++------- 2 files changed, 116 insertions(+), 50 deletions(-) diff --git a/reference/html/index.html b/reference/html/index.html index d0fa3966..542347bb 100644 --- a/reference/html/index.html +++ b/reference/html/index.html @@ -175,9 +175,10 @@ $(globalSwitch);
  • 6.24. The StripPrefix GatewayFilter Factory
  • 6.25. The Retry GatewayFilter Factory
  • 6.26. The RequestSize GatewayFilter Factory
  • -
  • 6.27. Modify a Request Body GatewayFilter Factory
  • -
  • 6.28. Modify a Response Body GatewayFilter Factory
  • -
  • 6.29. Default Filters
  • +
  • 6.27. The SetRequestHost GatewayFilter Factory
  • +
  • 6.28. Modify a Request Body GatewayFilter Factory
  • +
  • 6.29. Modify a Response Body GatewayFilter Factory
  • +
  • 6.30. Default Filters
  • 7. Global Filters @@ -2266,7 +2267,39 @@ The default request size is set to five MB if not provided as a filter argument
    -

    6.27. Modify a Request Body GatewayFilter Factory

    +

    6.27. The SetRequestHost GatewayFilter Factory

    +
    +

    There are certain situation when the host header may need to be overridden. In this situation, the SetRequestHost GatewayFilter factory can replace the existing host header with a specified vaue. +The filter takes a host parameter. +The following listing configures a SetRequestHost GatewayFilter:

    +
    +
    +
    Example 51. application.yml
    +
    +
    +
    +
    spring:
    +  cloud:
    +    gateway:
    +      routes:
    +      - id: set_request_host_header_route
    +        uri: http://localhost:8080/headers
    +        predicates:
    +        - Path=/headers
    +        filters:
    +        - name: SetRequestHost
    +          args:
    +            host: example.org
    +
    +
    +
    +
    +
    +

    The SetRequestHost GatewayFilter factory replaces the value of the host header with example.org.

    +
    +
    +
    +

    6.28. Modify a Request Body GatewayFilter Factory

    You can use the ModifyRequestBody filter filter to modify the request body before it is sent downstream by the gateway.

    @@ -2322,7 +2355,7 @@ static class Hello {
    -

    6.28. Modify a Response Body GatewayFilter Factory

    +

    6.29. Modify a Response Body GatewayFilter Factory

    You can use the ModifyResponseBody filter to modify the response body before it is sent back to the client.

    @@ -2360,14 +2393,14 @@ public RouteLocator routes(RouteLocatorBuilder builder) {
    -

    6.29. Default Filters

    +

    6.30. Default Filters

    To add a filter and apply it to all routes, you can use spring.cloud.gateway.default-filters. This property takes a list of filters. The following listing defines a set of default filters:

    -
    Example 51. application.yml
    +
    Example 52. application.yml
    @@ -2416,7 +2449,7 @@ This combined filter chain is sorted by the org.springframework.core.Order

    The following listing configures a filter chain:

    -
    Example 52. ExampleConfiguration.java
    +
    Example 53. ExampleConfiguration.java
    @@ -2463,7 +2496,7 @@ If so, the same rules apply. The following listing configures a LoadBalancerClientFilter:

    -
    Example 53. application.yml
    +
    Example 54. application.yml
    @@ -2538,7 +2571,7 @@ If so, the same rules apply. The following listing configures a ReactiveLoadBalancerClientFilter:

    -
    Example 54. application.yml
    +
    Example 55. application.yml
    @@ -2636,7 +2669,7 @@ If you use SockJS as a fallback over nor

    The following listing configures a websocket routing filter:

    -
    Example 55. application.yml
    +
    Example 56. application.yml
    @@ -2833,7 +2866,7 @@ or check if an exchange has already been routed.

    The following example shows how to do so:

    -
    Example 56. application.yml
    +
    Example 57. application.yml
    @@ -2853,7 +2886,7 @@ The following example shows how to do so:

    If you are routing to an HTTPS backend, you can configure the gateway to trust all downstream certificates with the following configuration:

    -
    Example 57. application.yml
    +
    Example 58. application.yml
    @@ -2872,7 +2905,7 @@ If you are routing to an HTTPS backend, you can configure the gateway to trust a For a production deployment, you can configure the gateway with a set of known certificates that it can trust with the following configuration:

    -
    Example 58. application.yml
    +
    Example 59. application.yml
    @@ -2900,7 +2933,7 @@ A number of timeouts are associated with this handshake. You can configure these timeouts can be configured (defaults shown) as follows:

    -
    Example 59. application.yml
    +
    Example 60. application.yml
    @@ -2927,7 +2960,7 @@ You can configure these timeouts can be configured (defaults shown) as follows:< The following listing shows the definition of the RouteDefinitionLocator interface:

    -
    Example 60. RouteDefinitionLocator.java
    +
    Example 61. RouteDefinitionLocator.java
    @@ -2946,7 +2979,7 @@ The following listing shows the definition of the RouteDefinitionLocator
    -
    Example 61. application.yml
    +
    Example 62. application.yml
    @@ -2980,7 +3013,7 @@ The following two examples are equivalent:

    You can configure additional parameters for each route by using metadata, as follows:

    -
    Example 62. application.yml
    +
    Example 63. application.yml
    @@ -3091,7 +3124,7 @@ import static org.springframework.cloud.gateway.support.RouteMetadataUtils.RESPO The following listing shows how it works:

    -
    Example 63. GatewaySampleApplication.java
    +
    Example 64. GatewaySampleApplication.java
    @@ -3158,7 +3191,7 @@ When doing so, you need to make sure to include the default predicate and filter The following example shows what this looks like:

    -
    Example 64. application.properties
    +
    Example 65. application.properties
    @@ -3201,7 +3234,7 @@ It must be a Java System Property, not a Spring Boot property.

    You can configure the logging system to have a separate access log file. The following example creates a Logback configuration:

  • 6.24. The StripPrefix GatewayFilter Factory
  • 6.25. The Retry GatewayFilter Factory
  • 6.26. The RequestSize GatewayFilter Factory
  • -
  • 6.27. Modify a Request Body GatewayFilter Factory
  • -
  • 6.28. Modify a Response Body GatewayFilter Factory
  • -
  • 6.29. Default Filters
  • +
  • 6.27. The SetRequestHost GatewayFilter Factory
  • +
  • 6.28. Modify a Request Body GatewayFilter Factory
  • +
  • 6.29. Modify a Response Body GatewayFilter Factory
  • +
  • 6.30. Default Filters
  • 7. Global Filters @@ -2266,7 +2267,39 @@ The default request size is set to five MB if not provided as a filter argument
    -

    6.27. Modify a Request Body GatewayFilter Factory

    +

    6.27. The SetRequestHost GatewayFilter Factory

    +
    +

    There are certain situation when the host header may need to be overridden. In this situation, the SetRequestHost GatewayFilter factory can replace the existing host header with a specified vaue. +The filter takes a host parameter. +The following listing configures a SetRequestHost GatewayFilter:

    +
    +
    +
    Example 51. application.yml
    +
    +
    +
    +
    spring:
    +  cloud:
    +    gateway:
    +      routes:
    +      - id: set_request_host_header_route
    +        uri: http://localhost:8080/headers
    +        predicates:
    +        - Path=/headers
    +        filters:
    +        - name: SetRequestHost
    +          args:
    +            host: example.org
    +
    +
    +
    +
    +
    +

    The SetRequestHost GatewayFilter factory replaces the value of the host header with example.org.

    +
    +
    +
    +

    6.28. Modify a Request Body GatewayFilter Factory

    You can use the ModifyRequestBody filter filter to modify the request body before it is sent downstream by the gateway.

    @@ -2322,7 +2355,7 @@ static class Hello {
    -

    6.28. Modify a Response Body GatewayFilter Factory

    +

    6.29. Modify a Response Body GatewayFilter Factory

    You can use the ModifyResponseBody filter to modify the response body before it is sent back to the client.

    @@ -2360,14 +2393,14 @@ public RouteLocator routes(RouteLocatorBuilder builder) {
    -

    6.29. Default Filters

    +

    6.30. Default Filters

    To add a filter and apply it to all routes, you can use spring.cloud.gateway.default-filters. This property takes a list of filters. The following listing defines a set of default filters:

    -
    Example 51. application.yml
    +
    Example 52. application.yml
    @@ -2416,7 +2449,7 @@ This combined filter chain is sorted by the org.springframework.core.Order

    The following listing configures a filter chain:

    -
    Example 52. ExampleConfiguration.java
    +
    Example 53. ExampleConfiguration.java
    @@ -2463,7 +2496,7 @@ If so, the same rules apply. The following listing configures a LoadBalancerClientFilter:

    -
    Example 53. application.yml
    +
    Example 54. application.yml
    @@ -2538,7 +2571,7 @@ If so, the same rules apply. The following listing configures a ReactiveLoadBalancerClientFilter:

    -
    Example 54. application.yml
    +
    Example 55. application.yml
    @@ -2636,7 +2669,7 @@ If you use SockJS as a fallback over nor

    The following listing configures a websocket routing filter:

    -
    Example 55. application.yml
    +
    Example 56. application.yml
    @@ -2833,7 +2866,7 @@ or check if an exchange has already been routed.

    The following example shows how to do so:

    -
    Example 56. application.yml
    +
    Example 57. application.yml
    @@ -2853,7 +2886,7 @@ The following example shows how to do so:

    If you are routing to an HTTPS backend, you can configure the gateway to trust all downstream certificates with the following configuration:

    -
    Example 57. application.yml
    +
    Example 58. application.yml
    @@ -2872,7 +2905,7 @@ If you are routing to an HTTPS backend, you can configure the gateway to trust a For a production deployment, you can configure the gateway with a set of known certificates that it can trust with the following configuration:

    -
    Example 58. application.yml
    +
    Example 59. application.yml
    @@ -2900,7 +2933,7 @@ A number of timeouts are associated with this handshake. You can configure these timeouts can be configured (defaults shown) as follows:

    -
    Example 59. application.yml
    +
    Example 60. application.yml
    @@ -2927,7 +2960,7 @@ You can configure these timeouts can be configured (defaults shown) as follows:< The following listing shows the definition of the RouteDefinitionLocator interface:

    -
    Example 60. RouteDefinitionLocator.java
    +
    Example 61. RouteDefinitionLocator.java
    @@ -2946,7 +2979,7 @@ The following listing shows the definition of the RouteDefinitionLocator
    -
    Example 61. application.yml
    +
    Example 62. application.yml
    @@ -2980,7 +3013,7 @@ The following two examples are equivalent:

    You can configure additional parameters for each route by using metadata, as follows:

    -
    Example 62. application.yml
    +
    Example 63. application.yml
    @@ -3091,7 +3124,7 @@ import static org.springframework.cloud.gateway.support.RouteMetadataUtils.RESPO The following listing shows how it works:

    -
    Example 63. GatewaySampleApplication.java
    +
    Example 64. GatewaySampleApplication.java
    @@ -3158,7 +3191,7 @@ When doing so, you need to make sure to include the default predicate and filter The following example shows what this looks like:

    -
    Example 64. application.properties
    +
    Example 65. application.properties
    @@ -3201,7 +3234,7 @@ It must be a Java System Property, not a Spring Boot property.

    You can configure the logging system to have a separate access log file. The following example creates a Logback configuration: