reverse-proxy
reverse-proxy copied to clipboard
Requests going to routes not specified with different host address.
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.
"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"
}
}
}
}
}
Host should be Hosts. https://microsoft.github.io/reverse-proxy/articles/config-files.html
Also, the Hosts field matches the incoming host header, it does not specify the outgoing destination.
We don't currently have schema validation to tag unknown fields which would flag this case. Adding to the backlog.
We could add a JSON schems file to https://www.schemastore.org/json/. This is what VS uses in appSettings.json today.