Welcome! Log In Create A New Profile

Advanced

NGINX perl module to server files

Jorge Sanchez
August 31, 2013 05:48PM
Hello,

I have created perl NGINX module to server static files on the NGINX
(mainly images). For security reasons I am generating the AES:CBC encrypted
url which I am decrypting on the NGINX and serving the file via NGINX perl
module. The problem is that I am sometimes getting the bellow response with
HTTP response code set to 000:


XX.XX.XX.XX - - [01/Sep/2013:01:20:37 +0400] "GET
/media/u5OU/NRkImrrwH/TThHe7hns5bOEv+Aou2/VJ8YD/ts= HTTP/1.1" *000* 39078 "
http://XXXX/full/JcbyEJTb8nMh+YH0xSg1jgl4N7vWQi2xBPep7VcJmD8=http://gruppu.com/full/JcbyEJTb8nMh+YH0xSg1jgl4N7vWQi2xBPep7VcJmD8="
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:23.0) Gecko/20100101
Firefox/23.0"


The way how I handle the url in the perl module is :

In case the file is found:
$r->sendfile($fileresult[0]);
$r->flush();
return OK;

else:
$r->status(404);
return DECLINED;


My question is if I am sending the files correctly or is there any other
specific value i should send back from perl (besides returning OK).

If needed I can send the nginx.conf.


Thanks for your help.

Regards,


Jorge
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

NGINX perl module to server files

Jorge Sanchez August 31, 2013 05:48PM

Re: NGINX perl module to server files

Jorge Sanchez September 01, 2013 05:30PM

Re: NGINX perl module to server files

Maxim Dounin September 01, 2013 09:28PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 277
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready