dotnet / dotnet/yarp

Multiple path matches for routes

Open
#2,987 2 comments 2 reactions 0 assignees View on GitHub
Type: Idea
Dominant language
C#
Stars
9.6k
Forks
933
Avg merge
12d 18h
Merged PRs (30d)
2

Description

### What should we add or change to make your life better?

Looking at the ["all config properties"](https://learn.microsoft.com/en-us/aspnet/core/fundamentals/servers/yarp/config-files?view=aspnetcore-10.0#all-config-properties), it looks like certain match filters can be provided with multiple values. I know some must support disjunction (a request can't have multiple hosts or methods, so it must match _at least one_ of the provided values) and others might support conjunction (all of these header or query parameter filters must match), so why can't the `Path` section be an array of accepted path patterns? In order to do this now, you have to create 1 route for every path, when you could only need 1 route with multiple paths and 1 cluster.

### Why is this important to you?

I'm working on a reverse proxy for my teams to use when developing web services locally. Most requests will go to a service with a one-to-one relationship with a cluster (e.g., exactly one route matches exactly one cluster). However, some requests might go to services that are run in a monolithic server (e.g., multiple services, each with their own route, run on the same host). It would be nice to have one cluster and one route for all of the different paths that should go to that one server.

I saw #1318, but I'm asking for the ability for a single route config to support multiple paths.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.