-
I'm trying to replace Apache with YARP for two sites that I host on my Raspberry Pi. I tried out YARP locally and created the following config that resemble my Raspberry Pi config. In this case I used the same hosts for testing, but on my Pi this would be two different hosts. The config is: {
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"AllowedHosts": "*",
"ReverseProxy": {
"Routes": [
{
"Blog": {
"RouteId": "blog",
"ClusterId": "blog",
"Match": {
"Path": "/blaat/{**remainder}",
"Hosts": [ "https://localhost:7259" ]
}
},
"PRM": {
"RouteId": "PRM",
"ClusterId": "PRM",
"Match": {
"Path": "/test/{**remainder}",
"Hosts": [ "https://localhost:7259" ]
}
}
}
],
"Clusters": [
{
"blog": {
"Destinations": {
"destination1": {
"Address": "https://nu.nl/"
}
}
},
"PRM": {
"Destinations": {
"destination1": {
"Address": "https://example.com/"
}
}
}
}
]
}
} However, when starting the project I get the following error in my program.cs: I looked at multiple examples, but I cannot figure out what's wrong with my config? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
It looks like the problem is the way - "Routes": [
+ "Routes":
{
"Blog": {
"RouteId": "blog",
"ClusterId": "blog",
"Match": {
"Path": "/blaat/{**remainder}",
"Hosts": [ "https://localhost:7259" ]
}
},
"PRM": {
"RouteId": "PRM",
"ClusterId": "PRM",
"Match": {
"Path": "/test/{**remainder}",
"Hosts": [ "https://localhost:7259" ]
}
}
}
- ],
+ , |
Beta Was this translation helpful? Give feedback.
It looks like the problem is the way
Routes
are set in the settings.Routes
used to be array but it's dictionary now. Removing brackets from theRoutes
should fix the problem.