-
I configured by proxy to listen on two different ports. How can I configure routing to match by port? I've tried to specify the port in "Kestrel": {
"Endpoints": {
"Https1": {
"Protocols": "Http1AndHttp2",
"Url": "https://localhost:5000"
},
"Https2": {
"Protocols": "Http1AndHttp2",
"Url": "https://localhost:6000"
}
}
},
"ReverseProxy": {
"Routes": [
{
"RouteId": "route1",
"ClusterId": "cluster1",
"Match": {
"Hosts": [ "localhost:5000" ],
"Path": "/{*remainder}"
},
"Transforms": [
{ "RequestHeadersCopy": "true" },
{ "RequestHeaderOriginalHost": "true" }
]
},
{
"RouteId": "route2",
"ClusterId": "cluster2",
"Match": {
"Hosts": [ "localhost:6000" ],
"Path": "/{*remainder}"
},
"Transforms": [
{ "RequestHeadersCopy": "true" },
{ "RequestHeaderOriginalHost": "true" }
]
}
],
"Clusters": [
"cluster1": {
"Destinations": {
"cluster1/destination1": {
"Address": "service1"
}
}
},
"cluster2": {
"Destinations": {
"cluster2/destination1": {
"Address": "service2"
}
}
}
]
} |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
There was an issue with specifying hosts with ports in config that was just fixed in preview10. #817 The preview10 release is currently in progress (#844). Give that a try and let us know. Note when you're specifying that a route matches Hosts you don't have to specify a Path. Also, RequestHeadersCopy already defaults to true so you can drop that setting. |
Beta Was this translation helpful? Give feedback.
-
With preview10, it now works perfectly! Thanks a lot. |
Beta Was this translation helpful? Give feedback.
There was an issue with specifying hosts with ports in config that was just fixed in preview10. #817
The preview10 release is currently in progress (#844). Give that a try and let us know.
Note when you're specifying that a route matches Hosts you don't have to specify a Path. Also, RequestHeadersCopy already defaults to true so you can drop that setting.