How to configure global rate limiting in ocelot.json
file?
#2164
Answered
by
raman-m
perisicnikola37
asked this question in
Q&A
-
How to enable global rate limiting on all defined endpoints without repeating the definitions at the end of each endpoint? This doesn't work: {
"Routes": [
{
"DownstreamPathTemplate": "/api/accounts",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "account_api",
"Port": "8080"
}
],
"UpstreamPathTemplate": "/accounts",
"UpstreamHttpMethod": ["POST"]
},
],
"GlobalConfiguration": {
"BaseUrl": "http://localhost:8010",
"RateLimitOptions": {
"ClientWhitelist": [],
"EnableRateLimiting": true,
"Period": "10s",
"PeriodTimespan": 10,
"Limit": 5
}
}
}
|
Beta Was this translation helpful? Give feedback.
Answered by
raman-m
Oct 4, 2024
Replies: 1 comment 8 replies
-
Hello, Nikola! And welcome to the world of Ocelot! 🐯 You are not alone, and such a question regarding global Rate Limiting options was asked by other developers:
To set up dynamic routing and apply global settings, consider reading the following documentation:
|
Beta Was this translation helpful? Give feedback.
8 replies
Answer selected by
raman-m
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello, Nikola! And welcome to the world of Ocelot! 🐯
You are not alone, and such a question regarding global Rate Limiting options was asked by other developers:
This discussion clarifies why the feature has not been implemented yet, as applying the same rate limiting to all static routes is considered poor DevOps practice.
To set up dynamic routing and apply global settings, consider reading the following documentation: