limit requests and CORS Policy

Ali Mohsin aliofthemohsins at
Fri Dec 18 13:54:57 UTC 2020

Hello, I want to setup limit requests on my API server but I want separate
limit to every separate link.
e.g i'm requesting to /api/link1 and i'm being blocked
I should be able to use /api/link2 normally if I don't exceed the limit.

I have achieved this with the following code

limit_req_zone $binary_remote_addr$v1 zone=mylimit:10m rate=3r/s;

location ~ "^/api/(?<v1>)$" {
limit_req zone=mylimit;

but i'm unable to set my CORS in headers and my APIs are inaccessible.

any help would be appreciated

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the nginx mailing list