Welcome! Log In Create A New Profile

Advanced

Re: Re: Re: exception for NGINX limit_req_zone

Francis Daly
July 22, 2012 02:36PM
On Sun, Jul 22, 2012 at 11:05:12PM +0800, fhal wrote:

Hi there,

> Thanks very much for your reply.
> It still doesn't work.

What, precisely, do you mean by "doesn't work"?

Be specific. (Do you mean "this one is being limited and I don't want
it to be", or "that one is not being limited and I do want it to be",
or something different?)

Read my mail again. I included the exact (small) nginx.conf fragment
used. I included the exact test command. I described what I saw. I
described what I expected to see.

Can you do the same, just so that I can make sure that I am repeating
exactly what you did?

> The URL I want to exclude is like
> /forum.php?mod=image&aid=1289568&size=300x300&key=6831686b88a927b0d9646529f88f5052&nocache=yes&type=fixnone
> Does it because there are too many parameters, the map is not working?

It still works for me.

for i in $(seq 4); do
curl -I 'http://127.0.0.1:8000/forum.php?mod=imag&aid=1289568&size=300x300&key=6831686b88a927b0d9646529f88f5052&nocache=yes&type=fixnone'
sleep 1
done

(Note: that has mod=imag, and so *should* be limited)

I see 3x HTTP 200 + 1x HTTP 503

for i in $(seq 4); do
curl -I 'http://127.0.0.1:8000/forum.php?mod=image&aid=1289568&size=300x300&key=6831686b88a927b0d9646529f88f5052&nocache=yes&type=fixnone'
sleep 1
done

(Note: that has mod=image, and so *should not* be limited)

I see 4x HTTP 200.

My nginx.conf http section:

===
http {
map $arg_mod $forum_limit {
default $binary_remote_addr;
image '';
}
limit_req_zone $forum_limit zone=refresh:128m rate=1r/m;

include fastcgi.conf;
server {
location ~*^/(home|forum|portal).php$ {
limit_req zone=refresh burst=2 nodelay;
fastcgi_pass unix:php.sock;
}
}
}
===

f
--
Francis Daly francis@daoine.org

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

exception for NGINX limit_req_zone

fhal July 20, 2012 09:50AM

Re: exception for NGINX limit_req_zone

Francis Daly July 20, 2012 06:40PM

Re:Re: exception for NGINX limit_req_zone

fhal July 20, 2012 10:28PM

Re: Re: exception for NGINX limit_req_zone

Francis Daly July 21, 2012 04:10PM

Re:Re: Re: exception for NGINX limit_req_zone

fhal July 22, 2012 11:06AM

Re: Re: Re: exception for NGINX limit_req_zone

Francis Daly July 22, 2012 02:36PM

Re:Re: Re: Re: exception for NGINX limit_req_zone

fhal July 23, 2012 09:26PM

Re: Re: Re: Re: exception for NGINX limit_req_zone

Francis Daly July 24, 2012 05:10PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 147
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