Ngx_http_secure_download report back to application?


I’m thinking about writing an application, which should use nginx’
secure download module to generate secure - expireing - links and limit
the number of (successful) downloads. Since it only should count
successful downloads it needs to know if the download was successful so
it would be good to have nginx report to the application “Hey, I’ve got
one more complete download”. In the best case also “Download failed, but
I transfered N bytes” for statistical reasons inside the application
(This could be used to track traffic usage by file and stop generating
links if a traffic limit has passed).

The download server and the application server could - but haven’t to -
run on different machines.

Now my question is: Is something like this possible? Can I send a
response to an application in - let’s say XML or JSON? And if yes: How?

Thanks in advance,

Pascal Nitsche


You can do this with

Martin Fjordvald

Posted at Nginx Forum:

Hello Ensiferous,

thanks for your answer I think this will do the trick. Is there also a
possibility to get the transfered bytes inside the request? (This would
be really nice but is just optional.)

Thanks for your help again,

Pascal Nitsche

Am 18.05.2011 15:03, schrieb Ensiferous: