Skip to content

Commit 3f1c708

Browse files
committed
YARP migration /2
1 parent b7d7b3b commit 3f1c708

File tree

14 files changed

+76
-19
lines changed

14 files changed

+76
-19
lines changed

aspnetcore/fundamentals/servers/yarp/authn-authz.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Example:
4949
}
5050
```
5151

52-
[Authorization policies](https://docs.microsoft.com/aspnet/core/security/authorization/policies) are an ASP.NET Core concept that the proxy utilizes. The proxy provides the above configuration to specify a policy per route and the rest is handled by existing ASP.NET Core authentication and authorization components.
52+
[Authorization policies](/aspnet/core/security/authorization/policies) are an ASP.NET Core concept that the proxy utilizes. The proxy provides the above configuration to specify a policy per route and the rest is handled by existing ASP.NET Core authentication and authorization components.
5353

5454
Authorization policies can be configured in the application as follows:
5555
```
@@ -69,7 +69,7 @@ app.UseAuthorization();
6969
app.MapReverseProxy();
7070
```
7171

72-
See the [Authentication](https://docs.microsoft.com/aspnet/core/security/authentication/) docs for setting up your preferred kind of authentication.
72+
See the [Authentication](/aspnet/core/security/authentication/) docs for setting up your preferred kind of authentication.
7373

7474
### Special values:
7575

@@ -105,7 +105,7 @@ These authentication types are often bound to a specific connection. They are no
105105

106106
### Client Certificates
107107

108-
Client certificates are a TLS feature and are negotiated as part of a connection. See [these docs](https://docs.microsoft.com/aspnet/core/security/authentication/certauth) for additional information. The certificate can be forwarded to the destination server as an HTTP header using the [ClientCert](transforms.md#clientcert) transform.
108+
Client certificates are a TLS feature and are negotiated as part of a connection. See [these docs](/aspnet/core/security/authentication/certauth) for additional information. The certificate can be forwarded to the destination server as an HTTP header using the [ClientCert](transforms.md#clientcert) transform.
109109

110110
### Swapping authentication types
111111

aspnetcore/fundamentals/servers/yarp/config-files.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ app.MapReverseProxy();
3636

3737
app.Run();
3838
```
39-
**Note**: For details about middleware ordering see [here](https://docs.microsoft.com/aspnet/core/fundamentals/middleware/#middleware-order).
39+
**Note**: For details about middleware ordering see [here](/aspnet/core/fundamentals/middleware/#middleware-order).
4040

4141
Configuration can be modified during the load sequence using [Configuration Filters](config-filters.md).
4242

@@ -93,7 +93,7 @@ Example:
9393
The routes section is an unordered collection of route matches and their associated configuration. A route requires at least the following fields:
9494
- RouteId - a unique name
9595
- ClusterId - refers to the name of an entry in the clusters section.
96-
- 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](https://docs.microsoft.com/aspnet/core/fundamentals/routing#route-templates).
96+
- 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).
9797
Route matching is based on the most specific routes having highest precedence as described [here]( https://docs.microsoft.com/aspnet/core/fundamentals/routing#url-matching). Explicit ordering can be achieved using the `order` field, with lower values taking higher priority.
9898

9999
[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).

aspnetcore/fundamentals/servers/yarp/config-filters.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
---
2+
uid: fundamentals/servers/yarp/config-filters
3+
title: Configuration Filters
4+
description: Configuration Filters
5+
author: rick-anderson
6+
ms.author: riande
7+
ms.date: 02/06/2025
8+
ms.topic: article
9+
content_well_notification: AI-contribution
10+
ms.prod: aspnet-core
11+
ai-usage: ai-assisted
12+
---
13+
114
# Configuration Filters
215

316
## Introduction

aspnetcore/fundamentals/servers/yarp/config-providers.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
---
2+
uid: fundamentals/servers/yarp/config-providers
3+
title: Extensibility: Configuration Providers
4+
description: Extensibility: Configuration Providers
5+
author: rick-anderson
6+
ms.author: riande
7+
ms.date: 02/06/2025
8+
ms.topic: article
9+
content_well_notification: AI-contribution
10+
ai-usage: ai-assisted
11+
---
12+
113
# Extensibility: Configuration Providers
214

315
## Introduction
@@ -14,7 +26,7 @@ Configuration can be modified during the load sequence using [Configuration Filt
1426
The routes section is an unordered collection of named routes. A route contains matches and their associated configuration. A route requires at least the following fields:
1527
- RouteId - a unique name
1628
- ClusterId - refers to the name of an entry in the clusters section.
17-
- 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](https://docs.microsoft.com/aspnet/core/fundamentals/routing#route-templates).
29+
- 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).
1830

1931
[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).
2032

aspnetcore/fundamentals/servers/yarp/cors.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
---
2+
uid: fundamentals/servers/yarp/cors
3+
title: Cross-Origin Requests (CORS)
4+
description: Cross-Origin Requests (CORS)
5+
author: rick-anderson
6+
ms.author: riande
7+
ms.date: 02/06/2025
8+
ms.topic: article
9+
content_well_notification: AI-contribution
10+
ai-usage: ai-assisted
11+
---
12+
113
# Cross-Origin Requests (CORS)
214

315
## Introduction
@@ -36,7 +48,7 @@ Example:
3648
}
3749
```
3850

39-
[CORS policies](https://docs.microsoft.com/aspnet/core/security/cors#cors-with-named-policy-and-middleware) are an ASP.NET Core concept that the proxy utilizes. The proxy provides the above configuration to specify a policy per route and the rest is handled by existing ASP.NET Core CORS Middleware.
51+
[CORS policies](/aspnet/core/security/cors#cors-with-named-policy-and-middleware) are an ASP.NET Core concept that the proxy utilizes. The proxy provides the above configuration to specify a policy per route and the rest is handled by existing ASP.NET Core CORS Middleware.
4052

4153
CORS policies can be configured in the application as follows:
4254
```

aspnetcore/fundamentals/servers/yarp/destination-resolvers.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
2+
---
3+
uid: fundamentals/servers/yarp/destination-resolvers
4+
title: Extensibility: Destination Resolvers
5+
description: Extensibility: Destination Resolvers
6+
author: rick-anderson
7+
ms.author: riande
8+
ms.date: 02/06/2025
9+
ms.topic: article
10+
content_well_notification: AI-contribution
11+
ai-usage: ai-assisted
12+
---
13+
114
# Extensibility: Destination Resolvers
215

316
## Introduction

aspnetcore/fundamentals/servers/yarp/diagnosing-yarp-issues.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
When using a reverse proxy, there is an additional hop from the client to the proxy, and then from the proxy to destination for things to go wrong. This topic should provide some hints and tips for how to debug and diagnose issues when they occur. It assumes that the proxy is already running, and so does not include problems at startup such as configuration errors.
44

55
## Logging
6-
The first step to being able to tell what is going on with YARP is to turn on [logging](https://docs.microsoft.com/aspnet/core/fundamentals/logging/#configure-logging). This is a configuration flag so can be changed on the fly. YARP is implemented as a middleware component for ASP.NET Core, so you need to enable logging for both YARP and ASP.NET to get the complete picture of what is going on.
6+
The first step to being able to tell what is going on with YARP is to turn on [logging](/aspnet/core/fundamentals/logging/#configure-logging). This is a configuration flag so can be changed on the fly. YARP is implemented as a middleware component for ASP.NET Core, so you need to enable logging for both YARP and ASP.NET to get the complete picture of what is going on.
77

88
By default ASP.NET will log to the console, and the configuration file can be used to control the level of logging.
99

@@ -170,7 +170,7 @@ Forwarder Telemetry [06:41:00.530] => OnForwarderStage :: Stage: ResponseContent
170170
Forwarder Telemetry [06:41:03.655] => OnForwarderStop :: Status: 200
171171
```
172172

173-
The events for Telemetry are fired as they occur, so you can [fish out the HttpContext](https://docs.microsoft.com/aspnet/core/fundamentals/http-context#use-httpcontext-from-custom-components) and the YARP feature from it:
173+
The events for Telemetry are fired as they occur, so you can [fish out the HttpContext](/aspnet/core/fundamentals/http-context#use-httpcontext-from-custom-components) and the YARP feature from it:
174174

175175
``` C#
176176
services.AddTelemetryConsumer<ForwarderTelemetry>();
@@ -220,7 +220,7 @@ public Task MyCustomProxyStep(HttpContext context, Func<Task> next)
220220
}
221221
```
222222

223-
You can also use [ASP.NET middleware](https://docs.microsoft.com/aspnet/core/fundamentals/middleware/write) within Configure that will enable you to inspect the request before the proxy pipeline.
223+
You can also use [ASP.NET middleware](/aspnet/core/fundamentals/middleware/write) within Configure that will enable you to inspect the request before the proxy pipeline.
224224

225225
> **Note:** The proxy will stream the response from the destination server back to the client, so the response headers and body are not readily accessible via middleware.
226226

aspnetcore/fundamentals/servers/yarp/getting-started.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
---
2-
uid: getting-started
2+
uid: fundamentals/servers/yarp/getting-started.md
3+
description: Getting Started with YARP
4+
author: rick-anderson
5+
ms.author: riande
6+
ms.date: 02/06/2025
7+
ms.topic: article
8+
content_well_notification: AI-contribution
9+
ai-usage: ai-assisted
310
title: Getting Started with YARP
411
---
512

aspnetcore/fundamentals/servers/yarp/grpc.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
gRPC requires HTTP/2 for most scenarios. HTTP/1.1 and HTTP/2 are enabled by default on ASP.NET Core servers (YARP's front end) but they require https (TLS) for HTTP/2 so YARP needs to be listening on a `https://` URL.
1010

11-
HTTP/2 over http (non-TLS) is only supported on Kestrel and requires specific settings. For details see [here](https://docs.microsoft.com/aspnet/core/grpc/aspnetcore#server-options).
11+
HTTP/2 over http (non-TLS) is only supported on Kestrel and requires specific settings. For details see [here](/aspnet/core/grpc/aspnetcore#server-options).
1212

1313
This shows configuring Kestrel to use HTTP/2 over http (non-TLS):
1414
```json

aspnetcore/fundamentals/servers/yarp/header-guidelines.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ The Host header indicates which site on the server the request is intended for.
5757

5858
### X-Forwarded-*, Forwarded
5959

60-
Because a separate connection is used to communicate with the destination, these request headers can be used to forward information about the original connection like the IP, scheme, port, client certificate, etc.. X-Forwarded-For, X-Forwarded-Proto, X-Forwarded-Host, and X-Forwarded-Prefix are enabled by default. This information is subject to spoofing attacks so any existing headers on the request are removed and replaced by default. The destination app should be careful about how much trust it places in these values. See [transforms](transforms.md#defaults) for configuring these in the proxy. See the [ASP.NET docs](https://docs.microsoft.com/aspnet/core/host-and-deploy/proxy-load-balancer) for configuring the destination app to read these headers.
60+
Because a separate connection is used to communicate with the destination, these request headers can be used to forward information about the original connection like the IP, scheme, port, client certificate, etc.. X-Forwarded-For, X-Forwarded-Proto, X-Forwarded-Host, and X-Forwarded-Prefix are enabled by default. This information is subject to spoofing attacks so any existing headers on the request are removed and replaced by default. The destination app should be careful about how much trust it places in these values. See [transforms](transforms.md#defaults) for configuring these in the proxy. See the [ASP.NET docs](/aspnet/core/host-and-deploy/proxy-load-balancer) for configuring the destination app to read these headers.
6161

6262
### X-http-method-override, x-http-method, x-method-override
6363

0 commit comments

Comments
 (0)