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

I use Kleeja script to host files and noticed that certain files are downloaded many more times than the site's visit counter indicates. So I assume that the files are being leeched. The web server is Nginx. Just wondering how to block leeching.

share|improve this question
I found a nice solution for nginx here: tech.nocr.at/hacking-security/hotlink-prevention-in-nginx – alfish Sep 6 '11 at 16:43

It is traditionally done by disallowing access or redirecting when the referrer is from another domain.

There are a number of ways to accomplish this, including using .htaccess files to redirect based on referrer. For nginx, NginxHttpRewriteModule

share|improve this answer
Thanks, Do you know how can I do this using nginx? – alfish Sep 6 '11 at 15:08
The nginx rewrite directive is mentioned in the link above. – alfish Sep 6 '11 at 16:50

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.