-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Routing question: placeholders vs slash #658
Comments
This doesn't work because /{everything} expects something after the slash, you need a reroute that is just /
Not sure if this is a typo? I assume it's working? |
So here is what is puzzling me (it is unexpected). Scenario 1Config 1{
"ReRoutes": [
{
"DownstreamPathTemplate": "/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "localhost",
"Port": 8000
}
],
"UpstreamPathTemplate": "/{everything}",
"UpstreamHttpMethod": [
"GET",
"POST"
],
"RateLimitOptions": {
"EnableRateLimiting": true,
"ClientWhiteList": [],
"Period": "1s",
"Limit": 1,
"PeriodTimespan": 5
}
}
],
"GlobalConfiguration": {
"BaseUrl": "http://localhost:5000",
"RateLimitOptions": {
"DisableRateLimitHeaders": false,
"QuotaExceededMessage": "Over limit",
"HttpStatusCode": 429
}
}
} Config1, where I configure that everything coming to ocelot, goes to
Scenario 2Config2{
"ReRoutes": [
{
"DownstreamPathTemplate": "/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "localhost",
"Port": 8000
}
],
"UpstreamPathTemplate": "/api/{everything}",
"UpstreamHttpMethod": [
"GET",
"POST"
],
"RateLimitOptions": {
"EnableRateLimiting": true,
"ClientWhiteList": [],
"Period": "1s",
"Limit": 1,
"PeriodTimespan": 5
}
}
],
"GlobalConfiguration": {
"BaseUrl": "http://localhost:5000",
"RateLimitOptions": {
"DisableRateLimitHeaders": false,
"QuotaExceededMessage": "Over limit",
"HttpStatusCode": 429
}
}
} Based on the Config1, I would expect similar behaviour, only it is not, and I believe it should be (at least based on my experience with Apache and Nginx proxy setttings.
Are you saying that if I want to achieve that, I would need to configure two |
@skyflyer yeh i think I might be wrong. This probably should work the way you expect but I don't know why it doesnt :/ I will mark this as a bug and see if we can get a fix! |
The issue has been accepted due to open PR #1333 by @AndyConlisk : |
Duplicate of #748 |
Fixed by #1911 |
Expected Behavior
/api/
would go to/
downstream/api/test
would go to/test
downstreamActual Behavior / Motivation for New Feature
/api/
is not resolved (see error below)/api/test
goes to downstream `/testSteps to Reproduce the Problem
Config:
Specifications
Comments
It is interesting to note, that if I configure ReRoute as
/{everything}
->/{everything}
, then it works, so it seems to me that{everything}
wildcard match is not consistent in theese two cases.The text was updated successfully, but these errors were encountered: