Skip to content

RateLimiting Not Working #474

Open
Open

Description

@DhanushAdla

I have followed as below but not able to figure out the issue.

builder.Services.AddMemoryCache();
builder.Services.Configure(options =>
{
options.GeneralRules = new List
{
new RateLimitRule
{
Endpoint="/eTest-service/eTest/*",
Limit=2,
Period="1m",
}
};
});

builder.Services.AddSingleton<IRateLimitCounterStore, MemoryCacheRateLimitCounterStore>();
builder.Services.AddSingleton<IIpPolicyStore, MemoryCacheIpPolicyStore>();
//builder.Services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>();
builder.Services.AddSingleton<IRateLimitConfiguration, RateLimitConfiguration>();
builder.Services.AddSingleton<IProcessingStrategy, AsyncKeyLockProcessingStrategy>();

app.UseIpRateLimiting();

I have endpoints as https://testing.com/eTest-service/eTest/method1 or method2 and so on...

Also health check as https://testing.com/health

I dont want to include rate limiting for health check when I add endpoint as * eveything is limited and when I add as /eTest-service/eTest/* it allows n number of times, basically limiting not working.

Could you please help on this.

Activity

  1. DhanushAdla commented on Dec 13, 2023

    @DhanushAdla
    Author

    Can someone please help on this!!

  2. ajshan23 commented on Apr 8, 2026

    @ajshan23

    fixed or not?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions