-
I have implemented Ocelot API Gateway in my Net Core 7 application. One of the JSON files containing routes is set up as follows: {
"Routes": [
{
"DownstreamPathTemplate": "/storedfiletype",
"DownstreamScheme": "https",
"DownstreamHostAndPorts": [
{
"Host": "<<<HOST DELETED FOR SECURITY>>>",
"Port": 443
}
],
"UpstreamPathTemplate": "/fileserver/storedfiletype",
"UpstreamHttpMethod": [ "Post" ]
},
{
"DownstreamPathTemplate": "/storedfiletype/fileextension",
"DownstreamScheme": "https",
"DownstreamHostAndPorts": [
{
"Host": "<<<HOST DELETED FOR SECURITY>>>",
"Port": 443
}
],
"UpstreamPathTemplate": "/fileserver/storedfiletype/fileextension",
"UpstreamHttpMethod": [ "Post" ]
}
]
} Now when I try and post to the first route ( Here are the logs I am getting:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Hi @dcmeadley ! I love your text replacement placeholder After review of your routes and exception which is:
...I would say that root cause is For example, if the route prefix is the same for some routes then you have to understand Catch All approach, and merge all related routes to one CatchAll-route. To fix the error you have to merge both routes, and introduce one {
"Routes": [
{
"DownstreamPathTemplate": "/storedfiletype/{everything}",
"DownstreamScheme": "https",
"DownstreamHostAndPorts": [
{
"Host": "<<<HOST DELETED FOR SECURITY>>>",
"Port": 443
}
],
"UpstreamPathTemplate": "/fileserver/storedfiletype/{everything}",
"UpstreamHttpMethod": [ "Post" ]
}
]
} Or even shorter template: "UpstreamPathTemplate": "/fileserver/{everything}", Hope you will provide a feedback soon! |
Beta Was this translation helpful? Give feedback.
-
We have the latest .NET 7 release with 19.0.2 version, so you can upgrade your gateway solution. 😉 |
Beta Was this translation helpful? Give feedback.
Hi @dcmeadley !
Thanks for your interest in Ocelot gateway!
I love your text replacement placeholder
<<<HOST DELETED FOR SECURITY>>>
🤣After review of your routes and exception which is:
...I would say that root cause is
Failed to match Route configuration for upstream path: /fileserver/storedfiletype
.This means th…