-
Hello, Is it possible to implement/extend the Match property with our own logic? In our environment we have a lot of remote sites and would like to do location based routing with yarp. EG something like: {
"ReverseProxy": {
"Routes": {
"route1" : {
"ClusterId": "cluster1",
"Match": {
"SuperCustomLocations" : [ "RemoteOffice1", "RemoteOffice2"]
},
}
},
"Clusters": {
"cluster1": {
"Destinations": {
"cluster1/destination1": {
"Address": "https://example.com/"
}
}
}
}
}
} Then we have our own implementation of SuperCustomLocations with code that calculates the string value from x-forwarded-for for eg. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Current idea is to try and implement a transform in code that injects a "Location" header into the request. Maybe a middleware? Edit: |
Beta Was this translation helpful? Give feedback.
Current idea is to try and implement a transform in code that injects a "Location" header into the request.
However I'm not sure that will work as I assume that to hit the transform it will have already evaluated the routes.
Maybe a middleware?
Edit:
Middleware was the answer :)