For Microsoft Reverse Proxy (https://github.com/microsoft/reverse-proxy) also known as YARP. Different from the other YARP: yarp.it
Questions tagged [ms-yarp]
75 questions
5
votes
3 answers
How to log to a file in asp.net core web app - wtihout any third party tools
I am currently have an application running where I want the logs to be sinked into a file, such that Datadog is able to fetch them.
I currently just uses the sourcegenerator to log, but how do i get these log down to a file?
I tried altered the…

I am not Fat
- 283
- 11
- 36
4
votes
1 answer
Microsoft C# .NET YARP 504 Gateway error and Failover
I am using Microsoft C# .NET YARP as an API gateway in front of ASP.NET Core Web API (latest version) with Swagger and Kestrel.
YARP is used for intern redirections to many microservices.
Questions:
I am facing 504 http API gateway error for…

Guru_07
- 362
- 3
- 15
3
votes
1 answer
Deserialize JSON for YARP config
The following JSON is my request body:
{
"Routes": {
"route1": {
"ClusterId": "cluster1",
"Match": {
"Path": "{**catch-all}",
"Hosts": ["www.aaaaa.com", "www.bbbbb.com"]
…

brunofer42
- 33
- 4
3
votes
1 answer
How can I access (forward) the public HTTP request IP address inside a docker compose network?
With the following setup:
only the YARP container has published ports. It correctly sets the X-Forward* headers for other containers to use. But unfortunately it's the docker compose gateway address.
When I want to log the (public) client's IP…

Parsa99
- 307
- 1
- 13
3
votes
2 answers
yarp rewriting hardcoded service urls
I don't know, if my question is well formulated, but I try...
I'm using yarp as a reverse proxy.
Behind the proxy there is a asp.net core service (order-service) on port 5048 e.g.
So the config looks like the following:
"ReverseProxy": {
"Routes":…

GreenEyedAndy
- 1,485
- 1
- 14
- 31
3
votes
1 answer
Yarp Reverse Proxy - Response 502 Bad Gateway
I want to implement a reverse proxy using Yarp. The Api is up and running as i can send request to it. However, anytime i try the same request through the proxy, i get an error 502 Bad gateway
Startup.cs
public void…

wunmi dawodu
- 29
- 4
2
votes
1 answer
YARP - How to modify subapplication path?
My Scenario
I have the following IIS site:
www.site.com
Calling www.site.com/Login redirects correctly to the page in my subapplication, the browser bar shows www.site.com/Login.
But, calling www.site.com, redirects to…

Gustavo Mauricio De Barros
- 165
- 2
- 14
2
votes
1 answer
Duende BFF Yarn does not pass tokens when using gRpc Web Client from Blazor WebAssembly app
I am building a web application with ASP.NET Core 6.
I have:
Frontend.Client - a Blazor WebAssembly with the UI
Frontend.Server - ASP.NET Core, hosting the Blazor WebAssembly
Web Api - a remote REST Service
gRpc Service - a remote gRpc…

user2632796
- 51
- 5
2
votes
2 answers
How to flow Net 6 Identity Authorisation to YARP Proxied Net Framework App
I'm trying to use the strangler fig pattern to migrate a legacy Net Framework MVC app in stages. I heard a talk by Mark Rendle about using YARP to migrate a Webforms app this way, which was great. However, I can't find any examples anywhere of using…

Jon Ryan
- 1,497
- 1
- 13
- 29
2
votes
1 answer
yarp with signalr .net core 5/6
I have created a basic chathub with signalr and want YARP to forward all the WS://<>/chat/ trafic to my API service; could anyway please share the YARP config file just to forward all the websocket traffic to an endpoint.
Any pointers would help.

Dhiru
- 159
- 2
- 5
2
votes
2 answers
"Short-circuit" YARP RequestTransform if condition is not met and return custom response
I am having issues figuring out how to stop a YARP request early and return a custom response if a certain condition is not met inside a request transform.
builderContext.AddRequestTransform(async transformContext =>
{
[...]
if…

elillesaeter
- 148
- 10
1
vote
0 answers
Exception "The SSL connection could not be established." when using Yarp.ReverseProxy in Docker linux container
I have an error
Yarp.ReverseProxy.Forwarder.HttpForwarder[48]
Request: An error was encountered before receiving a response.
System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception.
…

Serhii Shtokal
- 11
- 3
1
vote
1 answer
YARP - Routing based on regular expression
Is it possible to use regular expressions in Match-Path-rules to match general broader url-patterns and to be able to match very specific patterns. I dont want to use {**catch-all} but for example an ordinary RegExp like /api/\w{1,3}-\d{1,9} ...
Is…

user3154653
- 203
- 1
- 11
1
vote
0 answers
YARP authentication: how to refresh auth token
YARP-based service(just YARP) proxies a request to Service1. And what is important YARP authenticates on Service1. What is the best way to implement token refresh (see scheme)? In middleware? Another way? Would be grateful for an example.
scheme
I…

Andrey
- 11
- 2
1
vote
2 answers
Yarp Configuration with multiple web applications
I have 2 web (not api, let's assume razor) applications.
I'm trying to put them behind Yarp reverse proxy.
Here's my config:
"Yarp": {
"Routes": {
"web-route1": {
"ClusterId": "web-cluster1",
"Match": {
"Path":…

basilklochko
- 33
- 3