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

I know this is quite a basic question, but whereas i had no problem preventing image files from hotlinking, i can't figure out how i can't protect mp4 video files…

i just tried to specify mp4 next to jpg, (that's the two filetypes i need to protect), but as it works for jpg, mp4 does nothing !

Any idea ?

location ~* \.(jpg|mp4)$ {
valid_referers none blocked;
if ($invalid_referer) { return 403; }
share|improve this question
up vote 1 down vote accepted

Unfortunately whatever method you use to "protect" the progressive download, it can still be thwarted.

This problem is, that videos are specified as streaming contents.

Actually, many video-downloader tools are so powerful, so it is very difficult to protect the video files from being downloaded.

Usually, there is a three step solution:

  1. GET /path/to/file - return an HTML form with a capcha or some other method to avoid automa
  2. POST /path/to/file - return an HTTP redirect using a secure hash
  3. GET /path/to/file?hash=xxx - check the hash

You can perfect this method by implementing the H264 Streaming Module for nginx.

share|improve this answer
thank you very much for your answer, i'll have a look at the streaming module. Anyway, i don't realy want to protect the videos from downloading, i just don't want another website to embed the video on its own pages. Another solution anyway, could be to program a system with dynamically generated URLs so that it's not possible to copy it for further usage… – Buzut Dec 14 '12 at 17:15

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.