Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

On the past few hours my server is getting pretty loaded, mostly due to a lot of load requests. I've seen this thanks to the StatCounter realtime stats, which shows that the "Came from" page is:

And the Landing Page is

The CPU, mem and bandwidth are getting higher and higher, and I'd like to now if this could be some sort of attack.

This is a WordPress blog with WP 3.2.1, based on an Ubuntu 10.04.2 LTS, with Nginx, PHP-FPM and APC. Usually it runs pretty well, but I'm affraid this requests are loading the server to much.

The only explanation I have is that I've got the Simple Facebook Connect plugin to allow comments with a Facebook account, but it hasn't give any problems until now.

The strange thing is, the access.log shows the requests come from different IPs, so I guess it's not an attack - - [19/Oct/2011:18:20:53 +0200] "GET /?xd_receiver=1 HTTP/1.1" 403 189 "" "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; InfoPath.1)" - - [19/Oct/2011:18:20:48 +0200] "GET /?xd_receiver=1 HTTP/1.1" 403 135 "" "Mozilla/5.0 (Windows NT 5.1) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.202 Safari/535.1"


Is it possible in Nginx to block URLs for example that match the api_key parameter that is a constant in all these requests?

share|improve this question
It isn't worth thinking about blocking. The "visitors" get a 403 error and that's it. No problem. Go ahead. – mailq Oct 19 '11 at 16:38
Yes, but anyway I'd like to know if I can block them straight away with some kind of nginx parameter. The requests keep on producing high load... – javipas Oct 20 '11 at 8:01
up vote 4 down vote accepted

Yes, you can block an url in NGINX with regex like this:

location / {
    if ($uri ~* '^/(abc|def|ghi)$') {
         deny all;
    root  /var/www/

You can also block some referers:

if ($http_referer ~* (klm|nop|qrs)) {
    return 403;

Or user agent:

if ($http_user_agent ~ (libwww-perl|wget) ) {
    return 403;
share|improve this answer
Thanks, I blocked the referrer and it seems the problem dissapeared – javipas Nov 7 '11 at 12:14
deny is not allowed on location – brauliobo Dec 5 '15 at 10:20

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.