Skip to content

Instantly share code, notes, and snippets.

@fzankl
Last active September 14, 2021 17:08
Show Gist options
  • Save fzankl/dfaf098abf69821bd0f88a6f632b9337 to your computer and use it in GitHub Desktop.
Save fzankl/dfaf098abf69821bd0f88a6f632b9337 to your computer and use it in GitHub Desktop.
YARP - Configuration via appsettings.json with transformation
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"AllowedHosts": "*",
"ReverseProxy": {
"Routes": {
"route1": {
"ClusterId": "cluster1",
"Match": {
"Path": "/api/service1/{**catch-all}"
},
"Transforms": [
{
"PathRemovePrefix": "/api/service1/"
},
{
"ResponseHeader": "Source",
"Append": "YARP",
"When": "Success"
}
]
}
},
"Clusters": {
"cluster1": {
"LoadBalancingPolicy": "RoundRobin",
"Destinations": {
"cluster1/destination1": {
"Address": "https://localhost:5001/"
},
"cluster1/destination2": {
"Address": "https://localhost:5002/"
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment