Welcome! Log In Create A New Profile

Advanced

Re: limit requests and CORS Policy

Ali Mohsin
December 29, 2020 02:34AM
Hello, I have solved the issue, the problem was because of low request
limit, I had to add burst of 10 to make it work and I also changed my
configuration to the following.

limit_req_zone $binary_remote_addr$request_uri zone=mylimit:10m rate=5r/s;
and then
limit_req zone=mylimit burst=10 nodelay;

no other settings is changed.

On Sun, Dec 27, 2020 at 12:10 AM Francis Daly <francis@daoine.org> wrote:

> On Fri, Dec 18, 2020 at 06:54:57PM +0500, Ali Mohsin wrote:
>
> Hi there,
>
> > 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.
>
> Where are you trying to set your CORS in headers? In this location{}
> block, or in a different one? Or in a server{} block?
>
> What request are you making that is handled in this location{} block?
>
> I'd expect something like a ".*" in the regex to have it match everything
> that starts with /api/.
>
> Cheers,
>
> f
> --
> Francis Daly francis@daoine.org
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

limit requests and CORS Policy

Ali Mohsin December 18, 2020 08:56AM

Re: limit requests and CORS Policy

Francis Daly December 26, 2020 02:12PM

Re: limit requests and CORS Policy

Ali Mohsin December 29, 2020 02:34AM

Re: limit requests and CORS Policy

Francis Daly January 05, 2021 12:50PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 294
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready