Webmasters Stack Exchange is a question and answer site for pro webmasters. 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

A very popular website has begun using my Flickrshow javascript slideshow, but failed to notify me beforehand, and so is using a version that downloads the images used from my server. This is resulting in my server being inundated with 100+ requests per second for these images, and crashing or slowing the server to the point that it times out. Its also eating a load of bandwidth.

I am running a VPS using Ubuntu from Rackspace cloud, and have access to IPTables and/or Ubuntu Uncomplicated Firewall (UFW), but need to block by referrer since I can't tell what the IPs requesting the image will be. I don't want to let the request get as far as Apache as that is already affecting performance. Is it possible to block with a firewall or is there a better way? Something like ...

-A INPUT -m string --string "Referrer: http://www.rockinrio.com.br" --algo bm --to 65535 -j DROP

... was recommended but I can't get it to work, but then normally I use UFW.

share|improve this question

Using javascript's document.referrer string you can add an overlay on your thumbs saying : Unlicensed used of Flickrshow :-)

or better, display some ads by replacing the thumbnail with an ads display script and make money with them, they will quickly correct their website and offload your Apache web server :-)

You may find this interesting also


To block them at iptables rules level (to answer the real question) Don't forget that it will drop connections with everything with this string.

iptables -t raw -A PREROUTING -m string --algo bm --string "THE REFERRER DOMAIN ONLY" -j DROP


http://www.servercircle.com/Server-Firewalls/IPtables-match-on-string-of-characters_415 http://spamcleaner.org/en/misc/w00tw00t.html

share|improve this answer

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.