Welcome! Log In Create A New Profile

Advanced

Re: limit_req_zone: How to apply only to some requests containing some string in the URL?

October 23, 2013 11:38PM
Hi Francis,

Thanks a lot! You saved me probably a couple of days of research. It is working now!

I did this:

The user will send my a "capacity" parameter, with a value of 2X or 3X or 4X or......(etc)

map $arg_capacity $2X_key{~*2X $http_x_forwarded_for;default "";}
map $arg_capacity $3X_key{~*3X $http_x_forwarded_for;default "";}
map $arg_capacity $4X_key{~*4X $http_x_forwarded_for;default "";}
map $arg_capacity $5X_key{~*5X $http_x_forwarded_for;default "";}
map $arg_capacity $6X_key{~*6X $http_x_forwarded_for;default "";}
map $arg_capacity $7X_key{~*7X $http_x_forwarded_for;default "";}
map $arg_capacity $8X_key{~*8X $http_x_forwarded_for;default "";}
map $arg_capacity $9X_key{~*9X $http_x_forwarded_for;default "";}
map $arg_capacity $10X_key{~*10X $http_x_forwarded_for;default "";}

limit_req_zone $2X_key zone=2X:1m rate=600r/m;
limit_req_zone $3X_key zone=3X:1m rate=900r/m;
limit_req_zone $4X_key zone=4X:1m rate=1200r/m;
limit_req_zone $5X_key zone=5X:1m rate=1500r/m;
limit_req_zone $6X_key zone=6X:1m rate=1800r/m;
limit_req_zone $7X_key zone=7X:1m rate=2100r/m;
limit_req_zone $8X_key zone=8X:1m rate=2400r/m;
limit_req_zone $9X_key zone=9X:1m rate=2700r/m;
limit_req_zone $10X_key zone=10X:1m rate=3000r/m;

limit_req zone=2X burst=600;
limit_req zone=3X burst=900;
limit_req zone=4X burst=1200;
limit_req zone=5X burst=1500;
limit_req zone=6X burst=1800;
limit_req zone=7X burst=2100;
limit_req zone=8X burst=2400;
limit_req zone=9X burst=2700;
limit_req zone=10X burst=3000;
Subject Author Posted

limit_req_zone: How to apply only to some requests containing some string in the URL?

Brian08275660 October 22, 2013 11:42PM

Re: limit_req_zone: How to apply only to some requests containing some string in the URL?

Francis Daly October 23, 2013 04:10AM

Re: limit_req_zone: How to apply only to some requests containing some string in the URL?

Brian08275660 October 23, 2013 08:56AM

Re: limit_req_zone: How to apply only to some requests containing some string in the URL?

Francis Daly October 23, 2013 12:54PM

Re: limit_req_zone: How to apply only to some requests containing some string in the URL?

Brian08275660 October 23, 2013 01:38PM

Re: limit_req_zone: How to apply only to some requests containing some string in the URL?

Brian08275660 October 23, 2013 11:38PM

Re: limit_req_zone: How to apply only to some requests containing some string in the URL?

Brian08275660 October 25, 2013 01:31PM

Re: limit_req_zone: How to apply only to some requests containing some string in the URL?

Jader H. Silva October 25, 2013 02:00PM

Re: limit_req_zone: How to apply only to some requests containing some string in the URL?

Brian08275660 October 25, 2013 05:14PM

Re: limit_req_zone: How to apply only to some requests containing some string in the URL?

Brian08275660 October 25, 2013 07:07PM

Re: limit_req_zone: How to apply only to some requests containing some string in the URL?

Francis Daly October 26, 2013 08:54AM

Re: limit_req_zone: How to apply only to some requests containing some string in the URL?

Brian08275660 October 26, 2013 09:38AM

Re: limit_req_zone: How to apply only to some requests containing some string in the URL?

unclepieman October 25, 2013 05:04PM

Re: limit_req_zone: How to apply only to some requests containing some string in the URL?

Brian08275660 October 25, 2013 05:17PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 103
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready