Skip to content
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

Mix Global and Endpoint Rules #9

Closed
kspearrin opened this issue Dec 1, 2016 · 4 comments
Closed

Mix Global and Endpoint Rules #9

kspearrin opened this issue Dec 1, 2016 · 4 comments

Comments

@kspearrin
Copy link

Is it possible to mix a global rule with specific endpoint rules? For example I want to limit all endpoints globally to 1000 calls every 1 hour, but I also want to limit a specific endpoint with a more strict rule, like 1 per second. The documentation seems to indicate this is global or not with the EnableEndpointRateLimiting flag.

@stefanprodan
Copy link
Owner

Here is an example:

    "GeneralRules": [
      {
        "Endpoint": "*",
        "Period": "1h",
        "Limit": 1000
      },
      {
        "Endpoint": "*:/api/values",
        "Period": "1s",
        "Limit": 1
      }
    ]

This sets 1000 calls per hour to all endpoints and a limit of 1 call per second for the /api/values endpoints targeting all HTTP verbs.

@kspearrin
Copy link
Author

Do I set EnableEndpointRateLimiting to true or false when doing this?

@stefanprodan
Copy link
Owner

stefanprodan commented Dec 1, 2016

You have to set EnableEndpointRateLimiting=true for the endpoints limits to apply.

If EnableEndpointRateLimiting=false then only the rules that have "Endpoint": "*" will apply.

@kspearrin
Copy link
Author

Got it. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants