nginx as reverse proxy with "mod secdownload" feature - possible?

Reinis Rozitis r at
Tue Oct 19 19:10:08 MSD 2010

> nginx has no feature like mod_secdownload so far, right? Is there anything 
> i
> could do to get nginx working as a proxy with something like 
> mod_secdownload?
> maybe some perl module or so? the important thing would just be to have 
> every
> picture/video only downloaded once, or at least once in xx days...

I havent followed what is the current status with the TTL (time to live) 
secure downloads ( there is some blog post ) but 
we use

The secure link configuration is put on the caching servers (while of course 
you can duplicate it also on the backend in case you want to support also 
direct requests) which then fetch the object (if it doesnt exist in cache 
(local tree)) from backend via normal url (and do proxy_store locally) - the 
url normalising (striping out the hash parts) allows to store the same 
object just once).

But to implement the download-once feature you could use php (or any other 
dynamic backend) and do it via  X-Accel-Redirect ( ) - like transparently parse all the file 
downloading requests (through either try_files or rewrite) and let php 
decide if the file is available or not and nginx just does the transfer.


More information about the nginx mailing list