Questions about NGINX limit_req_zone
- by Meteor
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;
}