Questions about NGINX limit_req_zone
Posted
by
Meteor
on Server Fault
See other posts from Server Fault
or by Meteor
Published on 2012-07-19T15:42:12Z
Indexed on
2014/06/08
9:28 UTC
Read the original article
Hit count: 216
I got a problem with NGINX limit_req_zone. Anyone can help? The problem is that, I want to limit user access to some specific URL, for example:
/forum.php?mod=forumdisplay? /forum.php?mod=viewthread&***
But, I do want to add an exception for below URL,
/forum.php?mod=image&*
Below is the location section of my configuration, the problem is that, for URL started with /forum.php?mod=image&*, the limitation is still applied.
Any body can help?
location ~*^/forum.php?mod=image$ {
root /web/www;
fastcgi_pass unix:/tmp/nginx.socket;
fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
include fastcgi_params;
}
location ~*^/(home|forum|portal).php$ {
root /web/www;
limit_conn addr 5;
limit_req zone=refresh burst=5 nodelay;
fastcgi_pass unix:/tmp/nginx.socket;
fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
include fastcgi_params;
}
location ~ \.php$ {
root /web/www;
fastcgi_pass unix:/tmp/nginx.socket;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
include fastcgi_params;
}
© Server Fault or respective owner