Take note that while you are processing the content using embedded Perl or lua, the nginx worker which is processing is blocked, thus not serving anything. It migth be a better solution to check for viruses inside your webapp.<br>
<br><div class="gmail_quote">On Mon, Aug 29, 2011 at 01:01, Jérémie Pierson <span dir="ltr"><<a href="mailto:lists@ruby-forum.com">lists@ruby-forum.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi!<br>
<br>
I have a webapp that allows users to upload files. But before that<br>
webapp sees the files, I need to check them for viruses (with ClamAV).<br>
Requests are proxied by Nginx with a classic proxy_pass directive.<br>
<br>
I have tried tu use the embedded Perl module, without success.<br>
<br>
Specifically, I successfully got access to the body of the client<br>
request (i.e. the uploaded file's content), but have problem with the<br>
reply...<br>
<br>
If a virus is found, I want to reply with e.g. "403 Forbidden". But if<br>
the file is clean, I want the webapp to get it via proxy_pass as<br>
usual. I could only manage either always 403, or always pass to upstream<br>
:-(<br>
<br>
Is it possible to do that with the Perl module? I would prefer that<br>
solution as I don't have much time for the alternative :-)<br>
<br>
If not, could I write a handler module to do that? I read Evan Miller's<br>
guide to Nginx modules, but I'm not sure how to pass control to another<br>
handler in the "no-virus" case.<br>
<br>
<br>
<br>
--<br>
Jérémie<br>
<font color="#888888"><br>
--<br>
Posted via <a href="http://www.ruby-forum.com/" target="_blank">http://www.ruby-forum.com/</a>.<br>
_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx</a><br>
</font></blockquote></div><br>