diff --git a/aspnetcore/fundamentals/servers/yarp/ab-testing.md b/aspnetcore/fundamentals/servers/yarp/ab-testing.md index f85ab306e95a..b1ef529fd862 100644 --- a/aspnetcore/fundamentals/servers/yarp/ab-testing.md +++ b/aspnetcore/fundamentals/servers/yarp/ab-testing.md @@ -4,7 +4,7 @@ title: A/B Testing and Rolling Upgrades description: A/B Testing and Rolling Upgrades author: rick-anderson ms.author: riande -ms.date: 02/06/2025 +ms.date: 2/6/2025 ms.topic: article content_well_notification: AI-contribution ai-usage: ai-assisted diff --git a/aspnetcore/fundamentals/servers/yarp/authn-authz.md b/aspnetcore/fundamentals/servers/yarp/authn-authz.md index 535e087b14bc..062da8f3b66c 100644 --- a/aspnetcore/fundamentals/servers/yarp/authn-authz.md +++ b/aspnetcore/fundamentals/servers/yarp/authn-authz.md @@ -4,7 +4,7 @@ title: Authentication and Authorization description: Authentication and Authorization author: rick-anderson ms.author: riande -ms.date: 02/06/2025 +ms.date: 2/6/2025 ms.topic: article content_well_notification: AI-contribution ai-usage: ai-assisted diff --git a/aspnetcore/fundamentals/servers/yarp/config-files.md b/aspnetcore/fundamentals/servers/yarp/config-files.md index 284215ff02d4..9ab5ba06de9a 100644 --- a/aspnetcore/fundamentals/servers/yarp/config-files.md +++ b/aspnetcore/fundamentals/servers/yarp/config-files.md @@ -4,7 +4,7 @@ title: Configuration Files description: Configuration Files author: rick-anderson ms.author: riande -ms.date: 02/06/2025 +ms.date: 2/6/2025 ms.topic: article content_well_notification: AI-contribution ai-usage: ai-assisted @@ -37,7 +37,7 @@ app.Run(); ``` **Note**: For details about middleware ordering see [here](/aspnet/core/fundamentals/middleware/#middleware-order). -Configuration can be modified during the load sequence using [Configuration Filters](config-filters.md). +Configuration can be modified during the load sequence using [Configuration Filters](xref:fundamentals/servers/yarp/config-filters). ## Multiple Configuration Sources As of 1.1, YARP supports loading the proxy configuration from multiple sources. LoadFromConfig may be called multiple times referencing different IConfiguration sections or may be combine with a different config source like InMemory. Routes can reference clusters from other sources. Note merging partial config from different sources for a given route or cluster is not supported. @@ -95,7 +95,7 @@ The routes section is an unordered collection of route matches and their associa - Match - contains either a Hosts array or a Path pattern string. Path is an ASP.NET Core route template that can be defined as [explained here](/aspnet/core/fundamentals/routing#route-templates). Route matching is based on the most specific routes having highest precedence as described [here](/aspnet/core/fundamentals/routing#url-matching). Explicit ordering can be achieved using the `order` field, with lower values taking higher priority. -[Headers](header-routing.md), [Authorization](authn-authz.md), [CORS](cors.md), and other route based policies can be configured on each route entry. For additional fields see [RouteConfig](xref:Yarp.ReverseProxy.Configuration.RouteConfig). +[Headers](xref:fundamentals/servers/yarp/header-routing), [Authorization](xref:fundamentals/servers/yarp/authn-authz), [CORS](xref:fundamentals/servers/yarp/cors), and other route based policies can be configured on each route entry. For additional fields see [RouteConfig](xref:Yarp.ReverseProxy.Configuration.RouteConfig). The proxy will apply the given matching criteria and policies, and then pass off the request to the specified cluster. @@ -234,4 +234,4 @@ For additional fields see [ClusterConfig](xref:Yarp.ReverseProxy.Configuration.C } ``` -For more information see [logging configuration](diagnosing-yarp-issues.md#logging) and [HTTP client configuration](http-client-config.md). +For more information see [logging configuration](diagnosing-yarp-issues.md#logging) and [HTTP client configuration](xref:fundamentals/servers/yarp/http-client-config). diff --git a/aspnetcore/fundamentals/servers/yarp/config-filters.md b/aspnetcore/fundamentals/servers/yarp/config-filters.md index ea5e08c644f1..2c5be91b6ab6 100644 --- a/aspnetcore/fundamentals/servers/yarp/config-filters.md +++ b/aspnetcore/fundamentals/servers/yarp/config-filters.md @@ -4,7 +4,7 @@ title: Configuration Filters description: Configuration Filters author: rick-anderson ms.author: riande -ms.date: 02/06/2025 +ms.date: 2/6/2025 ms.topic: article content_well_notification: AI-contribution ai-usage: ai-assisted @@ -13,7 +13,7 @@ ai-usage: ai-assisted # Configuration Filters ## Introduction -YARP configuration for routes, clusters, and destinations can be loaded from [configuration files](config-files.md) or from [configuration providers](config-providers.md). Configuration filters can be used to modify that raw input before it's validated and applied. +YARP configuration for routes, clusters, and destinations can be loaded from [configuration files](xref:fundamentals/servers/yarp/config-files) or from [configuration providers](xref:fundamentals/servers/yarp/config-providers). Configuration filters can be used to modify that raw input before it's validated and applied. Filters can be used for a variety of purposes such as: - Supplementing config fields with data from other sources like the deployment environment diff --git a/aspnetcore/fundamentals/servers/yarp/config-providers.md b/aspnetcore/fundamentals/servers/yarp/config-providers.md index dab4ceed7579..d957b69b5fec 100644 --- a/aspnetcore/fundamentals/servers/yarp/config-providers.md +++ b/aspnetcore/fundamentals/servers/yarp/config-providers.md @@ -4,7 +4,7 @@ title: Extensibility Configuration Providers description: Extensibility Configuration Providers author: rick-anderson ms.author: riande -ms.date: 02/06/2025 +ms.date: 2/6/2025 ms.topic: article content_well_notification: AI-contribution ai-usage: ai-assisted @@ -17,7 +17,7 @@ The [Basic Yarp Sample](https://github.com/microsoft/reverse-proxy/tree/main/sam See [ReverseProxy.Code.Sample](https://github.com/microsoft/reverse-proxy/tree/main/samples/ReverseProxy.Code.Sample) for an example of a custom configuration provider. -Configuration can be modified during the load sequence using [Configuration Filters](config-filters.md). +Configuration can be modified during the load sequence using [Configuration Filters](xref:fundamentals/servers/yarp/config-filters). ## Structure [IProxyConfigProvider](xref:Yarp.ReverseProxy.Configuration.IProxyConfigProvider) has a single method `GetConfig()` that should return an [IProxyConfig](xref:Yarp.ReverseProxy.Configuration.IProxyConfig) instance. The IProxyConfig has lists of the current routes and clusters, as well as an `IChangeToken` to notify the proxy when this information is out of date and should be reloaded, which will cause `GetConfig()` to be called again. @@ -28,7 +28,7 @@ The routes section is an unordered collection of named routes. A route contains - ClusterId - refers to the name of an entry in the clusters section. - Match - contains either a Hosts array or a Path pattern string. Path is an ASP.NET Core route template that can be defined as [explained here](/aspnet/core/fundamentals/routing#route-templates). -[Headers](header-routing.md), [Authorization](authn-authz.md), [CORS](cors.md), and other route based policies can be configured on each route entry. For additional fields see [RouteConfig](xref:Yarp.ReverseProxy.Configuration.RouteConfig). +[Headers](xref:fundamentals/servers/yarp/header-routing), [Authorization](xref:fundamentals/servers/yarp/authn-authz), [CORS](xref:fundamentals/servers/yarp/cors), and other route based policies can be configured on each route entry. For additional fields see [RouteConfig](xref:Yarp.ReverseProxy.Configuration.RouteConfig). The proxy will apply the given matching criteria and policies, and then pass off the request to the specified cluster. diff --git a/aspnetcore/fundamentals/servers/yarp/cors.md b/aspnetcore/fundamentals/servers/yarp/cors.md index 631efbb8753a..3690f780a992 100644 --- a/aspnetcore/fundamentals/servers/yarp/cors.md +++ b/aspnetcore/fundamentals/servers/yarp/cors.md @@ -4,7 +4,7 @@ title: Cross-Origin Requests (CORS) description: Cross-Origin Requests (CORS) author: rick-anderson ms.author: riande -ms.date: 02/06/2025 +ms.date: 2/6/2025 ms.topic: article content_well_notification: AI-contribution ai-usage: ai-assisted diff --git a/aspnetcore/fundamentals/servers/yarp/destination-resolvers.md b/aspnetcore/fundamentals/servers/yarp/destination-resolvers.md index 60b00527ce0e..8397c0779f27 100644 --- a/aspnetcore/fundamentals/servers/yarp/destination-resolvers.md +++ b/aspnetcore/fundamentals/servers/yarp/destination-resolvers.md @@ -4,7 +4,7 @@ title: Extensibility Destination Resolvers description: Extensibility Destination Resolvers author: rick-anderson ms.author: riande -ms.date: 02/06/2025 +ms.date: 2/6/2025 ms.topic: article content_well_notification: AI-contribution ai-usage: ai-assisted diff --git a/aspnetcore/fundamentals/servers/yarp/dests-health-checks.md b/aspnetcore/fundamentals/servers/yarp/dests-health-checks.md index fe6522f052e6..3e90cd994951 100644 --- a/aspnetcore/fundamentals/servers/yarp/dests-health-checks.md +++ b/aspnetcore/fundamentals/servers/yarp/dests-health-checks.md @@ -4,7 +4,7 @@ title: Destination health checks description: Destination health checks author: rick-anderson ms.author: riande -ms.date: 02/06/2025 +ms.date: 2/6/2025 ms.topic: article content_well_notification: AI-contribution ai-usage: ai-assisted diff --git a/aspnetcore/fundamentals/servers/yarp/diagnosing-yarp-issues.md b/aspnetcore/fundamentals/servers/yarp/diagnosing-yarp-issues.md index d045c6eebddc..1772bbbfc88a 100644 --- a/aspnetcore/fundamentals/servers/yarp/diagnosing-yarp-issues.md +++ b/aspnetcore/fundamentals/servers/yarp/diagnosing-yarp-issues.md @@ -4,7 +4,7 @@ title: Diagnosing YARP-based proxies description: Diagnosing YARP-based proxies author: rick-anderson ms.author: riande -ms.date: 02/06/2025 +ms.date: 2/6/2025 ms.topic: article content_well_notification: AI-contribution ai-usage: ai-assisted diff --git a/aspnetcore/fundamentals/servers/yarp/direct-forwarding.md b/aspnetcore/fundamentals/servers/yarp/direct-forwarding.md index 9a2dc02dc901..d388b721bb94 100644 --- a/aspnetcore/fundamentals/servers/yarp/direct-forwarding.md +++ b/aspnetcore/fundamentals/servers/yarp/direct-forwarding.md @@ -4,7 +4,7 @@ title: Direct Forwarding description: Direct Forwarding author: rick-anderson ms.author: riande -ms.date: 02/06/2025 +ms.date: 2/6/2025 ms.topic: article content_well_notification: AI-contribution ai-usage: ai-assisted diff --git a/aspnetcore/fundamentals/servers/yarp/distributed-tracing.md b/aspnetcore/fundamentals/servers/yarp/distributed-tracing.md index c23391a085a3..5704fe6ad303 100644 --- a/aspnetcore/fundamentals/servers/yarp/distributed-tracing.md +++ b/aspnetcore/fundamentals/servers/yarp/distributed-tracing.md @@ -4,7 +4,7 @@ title: Distributed tracing description: Distributed tracing author: rick-anderson ms.author: riande -ms.date: 02/06/2025 +ms.date: 2/6/2025 ms.topic: article content_well_notification: AI-contribution ai-usage: ai-assisted @@ -28,7 +28,7 @@ These will only be created if there is a listener for the [`ActivitySource`](/do ### Example: Application Insights -For example, to monitor the traces with Application Insights, the proxy application needs to use the [Open Telemetry](https://github.com/open-telemetry/opentelemetry-dotnet/blob/main/src/OpenTelemetry/README.md) and [Azure Monitor](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/README.md) SDKs. +For example, to monitor the traces with Application Insights, the proxy application needs to use the [Open Telemetry](xref:fundamentals/servers/yarp/https://github.com/open-telemetry/opentelemetry-dotnet/blob/main/src/OpenTelemetry/README) and [Azure Monitor](xref:fundamentals/servers/yarp/https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/README) SDKs. `application.csproj`: diff --git a/aspnetcore/fundamentals/servers/yarp/getting-started.md b/aspnetcore/fundamentals/servers/yarp/getting-started.md index 51b35604bd5c..610f4400858c 100644 --- a/aspnetcore/fundamentals/servers/yarp/getting-started.md +++ b/aspnetcore/fundamentals/servers/yarp/getting-started.md @@ -4,7 +4,7 @@ title: Getting Started with YARP description: Getting Started with YARP author: rick-anderson ms.author: riande -ms.date: 02/06/2025 +ms.date: 2/6/2025 ms.topic: article content_well_notification: AI-contribution ai-usage: ai-assisted @@ -59,9 +59,9 @@ app.Run(); ## Configuration -The configuration for YARP is defined in the appsettings.json file. See [Configuration Files](config-files.md) for details. +The configuration for YARP is defined in the appsettings.json file. See [Configuration Files](xref:fundamentals/servers/yarp/config-files) for details. -The configuration can also be provided programmatically. See [Configuration Providers](config-providers.md) for details. +The configuration can also be provided programmatically. See [Configuration Providers](xref:fundamentals/servers/yarp/config-providers) for details. You can find out more about the available configuration options by looking at [RouteConfig](xref:Yarp.ReverseProxy.Configuration.RouteConfig) and [ClusterConfig](xref:Yarp.ReverseProxy.Configuration.ClusterConfig). diff --git a/aspnetcore/fundamentals/servers/yarp/grpc.md b/aspnetcore/fundamentals/servers/yarp/grpc.md index e7859e6d852a..a0607b4cc1db 100644 --- a/aspnetcore/fundamentals/servers/yarp/grpc.md +++ b/aspnetcore/fundamentals/servers/yarp/grpc.md @@ -4,7 +4,7 @@ title: Proxing gRPC description: Proxing gRPC author: rick-anderson ms.author: riande -ms.date: 02/06/2025 +ms.date: 2/6/2025 ms.topic: article content_well_notification: AI-contribution ai-usage: ai-assisted @@ -59,7 +59,7 @@ This shows configuring the outgoing proxy request to use HTTP/2 over http. [gRPC-Web](https://grpc.io/docs/platforms/web/basics/) is an alternative wire-format for gRPC that's compatible with HTTP/1.1. -* [`application/grpc`](https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md) - gRPC over HTTP/2 is how gRPC is typically used. -* [`application/grpc-web`](https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-WEB.md) - gRPC-Web modifies the gRPC protocol to be compatible with HTTP/1.1. gRPC-Web can be used in more places. gRPC-Web can be used by browser apps and in networks without complete support for HTTP/2. Two advanced gRPC features are not supported: client streaming and bidirectional streaming. +* [`application/grpc`](xref:fundamentals/servers/yarp/https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2) - gRPC over HTTP/2 is how gRPC is typically used. +* [`application/grpc-web`](xref:fundamentals/servers/yarp/https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-WEB) - gRPC-Web modifies the gRPC protocol to be compatible with HTTP/1.1. gRPC-Web can be used in more places. gRPC-Web can be used by browser apps and in networks without complete support for HTTP/2. Two advanced gRPC features are not supported: client streaming and bidirectional streaming. gRPC-Web can be proxied by YARP's default configuration without any special considerations. diff --git a/aspnetcore/fundamentals/servers/yarp/header-guidelines.md b/aspnetcore/fundamentals/servers/yarp/header-guidelines.md index 807f118f3c4b..a99bb4cf1c21 100644 --- a/aspnetcore/fundamentals/servers/yarp/header-guidelines.md +++ b/aspnetcore/fundamentals/servers/yarp/header-guidelines.md @@ -4,7 +4,7 @@ title: HTTP Headers description: HTTP Headers author: rick-anderson ms.author: riande -ms.date: 02/06/2025 +ms.date: 2/6/2025 ms.topic: article content_well_notification: AI-contribution ai-usage: ai-assisted diff --git a/aspnetcore/fundamentals/servers/yarp/header-routing.md b/aspnetcore/fundamentals/servers/yarp/header-routing.md index 213827b9bf9a..e94bd2a0fb5f 100644 --- a/aspnetcore/fundamentals/servers/yarp/header-routing.md +++ b/aspnetcore/fundamentals/servers/yarp/header-routing.md @@ -4,20 +4,15 @@ title: Header Based Routing description: Header Based Routing author: rick-anderson ms.author: riande -ms.date: 02/06/2025 +ms.date: 2/6/2025 ms.topic: article content_well_notification: AI-contribution ai-usage: ai-assisted --- ---- -uid: header-routing -title: Header Based Routing ---- - # Header Based Routing -Proxy routes specified in [config](config-files.md) or via [code](config-providers.md) must include at least a path or host to match against. In addition to these, a route can also specify one or more headers that must be present on the request. +Proxy routes specified in [config](xref:fundamentals/servers/yarp/config-files) or via [code](xref:fundamentals/servers/yarp/config-providers) must include at least a path or host to match against. In addition to these, a route can also specify one or more headers that must be present on the request. ### Precedence diff --git a/aspnetcore/fundamentals/servers/yarp/http-client-config.md b/aspnetcore/fundamentals/servers/yarp/http-client-config.md index 7148e7194156..645459ba9089 100644 --- a/aspnetcore/fundamentals/servers/yarp/http-client-config.md +++ b/aspnetcore/fundamentals/servers/yarp/http-client-config.md @@ -4,7 +4,7 @@ title: HTTP Client Configuration description: HTTP Client Configuration author: rick-anderson ms.author: riande -ms.date: 02/06/2025 +ms.date: 2/6/2025 ms.topic: article content_well_notification: AI-contribution ai-usage: ai-assisted @@ -162,7 +162,7 @@ The below example shows 2 samples of HTTP client and request configurations for ## Code Configuration HTTP client configuration uses the type [HttpClientConfig](xref:Yarp.ReverseProxy.Configuration.HttpClientConfig). -The following is an example of `HttpClientConfig` using [code based](config-providers.md) configuration. An instance of `HttpClientConfig` is assigned to the [ClusterConfig.HttpClient](xref:Yarp.ReverseProxy.Configuration.ClusterConfig) property before passing the cluster array to `LoadFromMemory` method. +The following is an example of `HttpClientConfig` using [code based](xref:fundamentals/servers/yarp/config-providers) configuration. An instance of `HttpClientConfig` is assigned to the [ClusterConfig.HttpClient](xref:Yarp.ReverseProxy.Configuration.ClusterConfig) property before passing the cluster array to `LoadFromMemory` method. ```C# var routes = new[] diff --git a/aspnetcore/fundamentals/servers/yarp/http3.md b/aspnetcore/fundamentals/servers/yarp/http3.md index c880c071192c..49819e7ad704 100644 --- a/aspnetcore/fundamentals/servers/yarp/http3.md +++ b/aspnetcore/fundamentals/servers/yarp/http3.md @@ -4,7 +4,7 @@ title: HTTP/3 description: HTTP/3 author: rick-anderson ms.author: riande -ms.date: 02/06/2025 +ms.date: 2/6/2025 ms.topic: article content_well_notification: AI-contribution ai-usage: ai-assisted diff --git a/aspnetcore/fundamentals/servers/yarp/https-tls.md b/aspnetcore/fundamentals/servers/yarp/https-tls.md index 73d84cf89374..88558bf45057 100644 --- a/aspnetcore/fundamentals/servers/yarp/https-tls.md +++ b/aspnetcore/fundamentals/servers/yarp/https-tls.md @@ -4,7 +4,7 @@ title: HTTPS & TLS description: HTTPS & TLS author: rick-anderson ms.author: riande -ms.date: 02/06/2025 +ms.date: 2/6/2025 ms.topic: article content_well_notification: AI-contribution ai-usage: ai-assisted @@ -36,6 +36,6 @@ To enable TLS encryption when communicating with a destination specify the desti The host name specified in the destination address will be used for the TLS handshake by default, including SNI and server certificate validation. If proxying the [original host header](transforms.md#requestheaderoriginalhost) is enabled, that value will be used for the TLS handshake instead. If a custom host value needs to be used then use the [RequestHeader](transforms.md#requestheader) transform to set the host header. -Outbound connections to the destinations are handled by HttpClient/SocketsHttpHandler. A different instance and settings can be configured per cluster. Some settings are available in the configuration model, while others can only be configured in code. See the [HttpClient](http-client-config.md) docs for details. +Outbound connections to the destinations are handled by HttpClient/SocketsHttpHandler. A different instance and settings can be configured per cluster. Some settings are available in the configuration model, while others can only be configured in code. See the [HttpClient](xref:fundamentals/servers/yarp/http-client-config) docs for details. -Destination server certificates need to be trusted by the proxy or custom validation needs to be applied via the [HttpClient](http-client-config.md) configuration. +Destination server certificates need to be trusted by the proxy or custom validation needs to be applied via the [HttpClient](xref:fundamentals/servers/yarp/http-client-config) configuration. diff --git a/aspnetcore/fundamentals/servers/yarp/httpsys-delegation.md b/aspnetcore/fundamentals/servers/yarp/httpsys-delegation.md index 030e574b4244..e250842500de 100644 --- a/aspnetcore/fundamentals/servers/yarp/httpsys-delegation.md +++ b/aspnetcore/fundamentals/servers/yarp/httpsys-delegation.md @@ -4,7 +4,7 @@ title: Http.sys Delegation description: Http.sys Delegation author: rick-anderson ms.author: riande -ms.date: 02/06/2025 +ms.date: 2/6/2025 ms.topic: article content_well_notification: AI-contribution ai-usage: ai-assisted diff --git a/aspnetcore/fundamentals/servers/yarp/kubernetes-ingress.md b/aspnetcore/fundamentals/servers/yarp/kubernetes-ingress.md index a908705ebe90..dbda547738cb 100644 --- a/aspnetcore/fundamentals/servers/yarp/kubernetes-ingress.md +++ b/aspnetcore/fundamentals/servers/yarp/kubernetes-ingress.md @@ -4,7 +4,7 @@ title: Kubernetes Ingress Controller description: Kubernetes Ingress Controller author: rick-anderson ms.author: riande -ms.date: 02/06/2025 +ms.date: 2/6/2025 ms.topic: article content_well_notification: AI-contribution ai-usage: ai-assisted diff --git a/aspnetcore/fundamentals/servers/yarp/lets-encrypt.md b/aspnetcore/fundamentals/servers/yarp/lets-encrypt.md index b1f33a16cab3..ce2c90c5656f 100644 --- a/aspnetcore/fundamentals/servers/yarp/lets-encrypt.md +++ b/aspnetcore/fundamentals/servers/yarp/lets-encrypt.md @@ -4,7 +4,7 @@ title: Lets Encrypt description: Lets Encrypt author: rick-anderson ms.author: riande -ms.date: 02/06/2025 +ms.date: 2/6/2025 ms.topic: article content_well_notification: AI-contribution ai-usage: ai-assisted diff --git a/aspnetcore/fundamentals/servers/yarp/load-balancing.md b/aspnetcore/fundamentals/servers/yarp/load-balancing.md index e7ce09ea0a02..02963255a466 100644 --- a/aspnetcore/fundamentals/servers/yarp/load-balancing.md +++ b/aspnetcore/fundamentals/servers/yarp/load-balancing.md @@ -4,7 +4,7 @@ title: Load Balancing description: Load Balancing author: rick-anderson ms.author: riande -ms.date: 02/06/2025 +ms.date: 2/6/2025 ms.topic: article content_well_notification: AI-contribution ai-usage: ai-assisted diff --git a/aspnetcore/fundamentals/servers/yarp/middleware.md b/aspnetcore/fundamentals/servers/yarp/middleware.md index a36ce58e14a4..42dd55c38b10 100644 --- a/aspnetcore/fundamentals/servers/yarp/middleware.md +++ b/aspnetcore/fundamentals/servers/yarp/middleware.md @@ -4,7 +4,7 @@ title: Middleware description: Middleware author: rick-anderson ms.author: riande -ms.date: 02/06/2025 +ms.date: 2/6/2025 ms.topic: article content_well_notification: AI-contribution ai-usage: ai-assisted @@ -17,7 +17,7 @@ ai-usage: ai-assisted ASP.NET Core uses a [middleware pipeline](/aspnet/core/fundamentals/middleware/) to divide request processing into discrete steps. The app developer can add and order middleware as needed. ASP.NET Core middleware is also used to implement and customize reverse proxy functionality. ## Defaults -The [getting started](getting-started.md) sample shows the following Configure method. This sets up a middleware pipeline with development tools, routing, and proxy configured endpoints (`MapReverseProxy`). +The [getting started](xref:fundamentals/servers/yarp/getting-started) sample shows the following Configure method. This sets up a middleware pipeline with development tools, routing, and proxy configured endpoints (`MapReverseProxy`). ```C# var builder = WebApplication.CreateBuilder(args); @@ -28,11 +28,11 @@ app.MapReverseProxy(); app.Run(); ``` -The parmeterless `MapReverseProxy()` in [ReverseProxyIEndpointRouteBuilderExtensions](xref:Microsoft.AspNetCore.Builder.ReverseProxyIEndpointRouteBuilderExtensions) overload includes all standard proxy middleware for [session affinity](session-affinity.md), [load balancing](load-balancing.md), [passive health checks](dests-health-checks.md#passive-health-checks), and the final proxying of the request. Each of these check the configuration of the matched route, cluster, and destination and perform their task accordingly. +The parmeterless `MapReverseProxy()` in [ReverseProxyIEndpointRouteBuilderExtensions](xref:Microsoft.AspNetCore.Builder.ReverseProxyIEndpointRouteBuilderExtensions) overload includes all standard proxy middleware for [session affinity](xref:fundamentals/servers/yarp/session-affinity), [load balancing](xref:fundamentals/servers/yarp/load-balancing), [passive health checks](dests-health-checks.md#passive-health-checks), and the final proxying of the request. Each of these check the configuration of the matched route, cluster, and destination and perform their task accordingly. ## Adding Middleware -Middleware added to your application pipeline will see the request in different states of processing depending on where the middleware is added. Middleware added before `UseRouting` will see all requests and can manipulate them before any routing takes place. Middleware added between `UseRouting` and `UseEndpoints` can call `HttpContext.GetEndpoint()` to check which endpoint routing matched the request to (if any), and use any metadata that was associated with that endpoint. This is how [Authentication, Authorization](authn-authz.md) and [CORS](cors.md) are handled. +Middleware added to your application pipeline will see the request in different states of processing depending on where the middleware is added. Middleware added before `UseRouting` will see all requests and can manipulate them before any routing takes place. Middleware added between `UseRouting` and `UseEndpoints` can call `HttpContext.GetEndpoint()` to check which endpoint routing matched the request to (if any), and use any metadata that was associated with that endpoint. This is how [Authentication, Authorization](xref:fundamentals/servers/yarp/authn-authz) and [CORS](xref:fundamentals/servers/yarp/cors) are handled. [ReverseProxyIEndpointRouteBuilderExtensions](xref:Microsoft.AspNetCore.Builder.ReverseProxyIEndpointRouteBuilderExtensions) provides an overload of `MapReverseProxy` that lets you build a middleware pipeline that will run only for requests matched to proxy configured routes. @@ -132,7 +132,7 @@ proxyPipeline.Use(async (context, next) => Middleware can wrap the call to `await next()` in a try/catch block to handle exceptions from later components. -The proxy logic at the end of the pipeline ([IHttpForwarder](direct-forwarding.md)) does not throw exceptions for common request proxy errors. These are captured and reported in the [IForwarderErrorFeature](xref:Yarp.ReverseProxy.Forwarder.IForwarderErrorFeature) available from `HttpContext.Features` or the `HttpContext.GetForwarderErrorFeature()` extension method. +The proxy logic at the end of the pipeline ([IHttpForwarder](xref:fundamentals/servers/yarp/direct-forwarding)) does not throw exceptions for common request proxy errors. These are captured and reported in the [IForwarderErrorFeature](xref:Yarp.ReverseProxy.Forwarder.IForwarderErrorFeature) available from `HttpContext.Features` or the `HttpContext.GetForwarderErrorFeature()` extension method. ```C# proxyPipeline.Use(async (context, next) => @@ -151,9 +151,9 @@ If the response has not started (`HttpResponse.HasStarted`) it can be cleared (` ## What not to do with middleware -Middleware should be cautious about modifying request fields such as headers in order to affect the outgoing proxied request. Such modifications may interfere with features like retries and may be better handled by [transforms](transforms.md). +Middleware should be cautious about modifying request fields such as headers in order to affect the outgoing proxied request. Such modifications may interfere with features like retries and may be better handled by [transforms](xref:fundamentals/servers/yarp/transforms). -Middleware MUST check `HttpResponse.HasStarted` before modifying response fields after calling `next()`. If the response has already started being sent to the client then the middleware can no longer modify it (except maybe Trailers). [Transforms](transforms.md) can be used to inspect and suppress unwanted responses. Otherwise see the next note. +Middleware MUST check `HttpResponse.HasStarted` before modifying response fields after calling `next()`. If the response has already started being sent to the client then the middleware can no longer modify it (except maybe Trailers). [Transforms](xref:fundamentals/servers/yarp/transforms) can be used to inspect and suppress unwanted responses. Otherwise see the next note. Middleware should avoid interacting with the request or response bodies. Bodies are not buffered by default, so interacting with them can prevent them from reaching their destinations. While enabling buffering is possible, it's discouraged as it can add significant memory and latency overhead. Using a wrapped, streaming approach is recommended if the body must be examined or modified. See the [ResponseCompression](https://github.com/dotnet/aspnetcore/blob/24588220006bc164b63293129cc94ac6292250e4/src/Middleware/ResponseCompression/src/ResponseCompressionMiddleware.cs#L55-L73) middleware for an example. diff --git a/aspnetcore/fundamentals/servers/yarp/output-caching.md b/aspnetcore/fundamentals/servers/yarp/output-caching.md index cf41b8099bdb..3b3139355280 100644 --- a/aspnetcore/fundamentals/servers/yarp/output-caching.md +++ b/aspnetcore/fundamentals/servers/yarp/output-caching.md @@ -4,7 +4,7 @@ title: Output Caching description: Output Caching author: rick-anderson ms.author: riande -ms.date: 02/06/2025 +ms.date: 2/6/2025 ms.topic: article content_well_notification: AI-contribution ai-usage: ai-assisted diff --git a/aspnetcore/fundamentals/servers/yarp/queryparameter-routing.md b/aspnetcore/fundamentals/servers/yarp/queryparameter-routing.md index 7bf27f884aed..2a41dfddbf46 100644 --- a/aspnetcore/fundamentals/servers/yarp/queryparameter-routing.md +++ b/aspnetcore/fundamentals/servers/yarp/queryparameter-routing.md @@ -4,7 +4,7 @@ title: Query Parameter Based Routing description: Query Parameter Based Routing author: rick-anderson ms.author: riande -ms.date: 02/06/2025 +ms.date: 2/6/2025 ms.topic: article content_well_notification: AI-contribution ai-usage: ai-assisted @@ -12,7 +12,7 @@ ai-usage: ai-assisted # Query Parameter Based Routing -Proxy routes specified in [config](config-files.md) or via [code](config-providers.md) must include at least a path or host to match against. In addition to these, a route can also specify one or more query parameters that must be present on the request. +Proxy routes specified in [config](xref:fundamentals/servers/yarp/config-files) or via [code](xref:fundamentals/servers/yarp/config-providers) must include at least a path or host to match against. In addition to these, a route can also specify one or more query parameters that must be present on the request. ### Precedence diff --git a/aspnetcore/fundamentals/servers/yarp/rate-limiting.md b/aspnetcore/fundamentals/servers/yarp/rate-limiting.md index 8025e5bf3839..470e7740ab07 100644 --- a/aspnetcore/fundamentals/servers/yarp/rate-limiting.md +++ b/aspnetcore/fundamentals/servers/yarp/rate-limiting.md @@ -4,7 +4,7 @@ title: Rate Limiting description: Rate Limiting author: rick-anderson ms.author: riande -ms.date: 02/06/2025 +ms.date: 2/6/2025 ms.topic: article content_well_notification: AI-contribution ai-usage: ai-assisted diff --git a/aspnetcore/fundamentals/servers/yarp/service-fabric-int.md b/aspnetcore/fundamentals/servers/yarp/service-fabric-int.md index fb0091d02c6f..9ca12088f10f 100644 --- a/aspnetcore/fundamentals/servers/yarp/service-fabric-int.md +++ b/aspnetcore/fundamentals/servers/yarp/service-fabric-int.md @@ -4,7 +4,7 @@ title: Service Fabric Integration description: Service Fabric Integration author: rick-anderson ms.author: riande -ms.date: 02/06/2025 +ms.date: 2/6/2025 ms.topic: article content_well_notification: AI-contribution ai-usage: ai-assisted diff --git a/aspnetcore/fundamentals/servers/yarp/session-affinity.md b/aspnetcore/fundamentals/servers/yarp/session-affinity.md index a8fe6b4611a2..4b02bcf4ab68 100644 --- a/aspnetcore/fundamentals/servers/yarp/session-affinity.md +++ b/aspnetcore/fundamentals/servers/yarp/session-affinity.md @@ -4,7 +4,7 @@ title: Session Affinity description: Session Affinity author: rick-anderson ms.author: riande -ms.date: 02/06/2025 +ms.date: 2/6/2025 ms.topic: article content_well_notification: AI-contribution ai-usage: ai-assisted diff --git a/aspnetcore/fundamentals/servers/yarp/timeouts.md b/aspnetcore/fundamentals/servers/yarp/timeouts.md index 84f97990ec91..c5de7c512cf6 100644 --- a/aspnetcore/fundamentals/servers/yarp/timeouts.md +++ b/aspnetcore/fundamentals/servers/yarp/timeouts.md @@ -4,7 +4,7 @@ title: Request Timeouts description: Request Timeouts author: rick-anderson ms.author: riande -ms.date: 02/06/2025 +ms.date: 2/6/2025 ms.topic: article content_well_notification: AI-contribution ai-usage: ai-assisted diff --git a/aspnetcore/fundamentals/servers/yarp/transforms.md b/aspnetcore/fundamentals/servers/yarp/transforms.md index d73fb0b67651..40a8b2b459b9 100644 --- a/aspnetcore/fundamentals/servers/yarp/transforms.md +++ b/aspnetcore/fundamentals/servers/yarp/transforms.md @@ -4,7 +4,7 @@ title: Request and Response Transforms description: Request and Response Transforms author: rick-anderson ms.author: riande -ms.date: 02/06/2025 +ms.date: 2/6/2025 ms.topic: article content_well_notification: AI-contribution ai-usage: ai-assisted diff --git a/aspnetcore/fundamentals/servers/yarp/websockets.md b/aspnetcore/fundamentals/servers/yarp/websockets.md index b5d21ce9d248..7daec0978c4c 100644 --- a/aspnetcore/fundamentals/servers/yarp/websockets.md +++ b/aspnetcore/fundamentals/servers/yarp/websockets.md @@ -4,7 +4,7 @@ title: Proxing WebSockets and SPDY description: Proxing WebSockets and SPDY author: rick-anderson ms.author: riande -ms.date: 02/06/2025 +ms.date: 2/6/2025 ms.topic: article content_well_notification: AI-contribution ai-usage: ai-assisted @@ -14,7 +14,7 @@ ai-usage: ai-assisted ## Introduction -YARP enables proxying WebSocket and SPDY connections by default. This support works with both the [direct forwarding](direct-forwarding.md) and [full pipeline](getting-started.md) approaches. +YARP enables proxying WebSocket and SPDY connections by default. This support works with both the [direct forwarding](xref:fundamentals/servers/yarp/direct-forwarding) and [full pipeline](xref:fundamentals/servers/yarp/getting-started) approaches. [WebSockets](https://www.rfc-editor.org/rfc/rfc6455.html) is a bidirectional streaming protocol built on HTTP/1.1 and later adapted to [HTTP/2](https://datatracker.ietf.org/doc/html/rfc8441). @@ -36,4 +36,4 @@ After the initial handshake WebSockets function the same way over both HTTP vers ## Timeout -[Http Request Timeouts](/aspnet/core/performance/timeouts) (.NET 8+) can apply timeouts to all requests by default or by policy. These timeouts will be disabled after a WebSocket handshake. They will still apply to gRPC requests. For additional configuration see [Timeouts](timeouts.md). +[Http Request Timeouts](/aspnet/core/performance/timeouts) (.NET 8+) can apply timeouts to all requests by default or by policy. These timeouts will be disabled after a WebSocket handshake. They will still apply to gRPC requests. For additional configuration see [Timeouts](xref:fundamentals/servers/yarp/timeouts).