Ngx_http_secure_download report back to application?

Hello,

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

Hi,

You can do this with http://wiki.nginx.org/HttpCoreModule#post_action
and http://wiki.nginx.org/HttpCoreModule#.24request_completion

Sincerely,
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: