dotnet / dotnet/yarp

Requests going to routes not specified with different host address.

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

Description

I have a simple config like below.
When I enter the following address: `https://localhost:5678/meow/helloworld`
Then it is routed https://localhost:5678. I am confused because I am under the impression that
**meow/helloworld** will only be routed to **https://localhost:1234**.
Is this a normal behavior? If we have specific hosts listed, shouldn't the route go to the specified hosts for its section? This route **meow/helloworld** should never go to this host: https://localhost:5678.

```json
"ReverseProxy": {
"Routes": {
"route1": {
"ClusterId": "cluster1",
"Match": {
"Path": "meow/helloworld",
"Host": [ "https://localhost:1234" ]
},
"Transforms": [ { "PathRemovePrefix": "/meow" } ]
},
"route2": {
"ClusterId": "cluster2",
"Match": {
"Path": "roar/goodbyworld",
"Host": [ "https://localhost:5678"]
},
"Transforms": [ { "PathRemovePrefix": "/roar" } ]
}
},
"Clusters": {
"cluster1": {
"Destinations": {
"destination1": {
"Address": "destination1"
}
}
},
"cluster2": {
"Destinations": {
"destinatio2": {
"Address": "destination2"
}
}
}
}
}
```

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.