New Ubuntu-Light ppa with the latest nginx code

Hello List,

I have just set up an Ubuntu ppa to always keep a tab on the latest
Nnginx code (currently 0.9.4).

As usual in Ubuntu, you may install it using the following commands:
sudo add-apt-repository ppa:malan/dev
sudo apt-get update
sudo apt-get install nginx

This ppa has been created to let Nginx coexist peacefully with
php5-fpm and Drupal.

WARNING: this is a ‘LIGHT’ version that has been created to let Nginx
coexist peacefully with php5-fpm and Drupal (and other cgi dependent
apps) as such it has 3 main differences from plain Nginx packages:

  1. it has been compiled without the following modules: empty_gif,
    limit_req, pop3, smtp, imap, split_clients, uwsgi, scgi, cache;
  2. it has been patched to be an ‘anonymized’ web server that only
    reports ‘webserver/0.0.0’ as server name and version;
  3. the ivp6 line has been removed from sites-available/default.

Regards,

M.

Hey.

How can i implement mp4; on this

Tried many ways, but urls doesnt work when mp4; is added

It will only be .mp4 files on this script.

nginx.conf code below:
location /d/ {
perl download::handler;
}

     # usergroup1
     location /download_f/ {
         alias /disk1/site.com/cgi-bin/uploads/;
         internal;
         set $limit_rate $arg_speed;
         limit_conn one 1;
     }

     # usergroup2
     location /download_r/ {
         alias /disk1/site.com/cgi-bin/uploads/;
         internal;
         set $limit_rate $arg_speed;
         limit_conn one 1;
     }

     # usergroup3
     location /download_p/ {
         alias /disk1/site.com/cgi-bin/uploads/;
         internal;
         set $limit_rate $arg_speed;
         limit_conn one 10;
     }

download.pm code below:
package download;
use strict;
use nginx;
use Crypt::HCE_MD5;

my $dl_key = “somekey”;
my $upload_dir="/disk1/site.com/cgi-bin/uploads/";

sub handler {
my $r = shift;

 my $hce = Crypt::HCE_MD5->new($dl_key,"SOMENAME");
 ($_) = $r->filename=~/\/(\w+)\/[^\/]+$/;
 my $l;
 tr|a-z2-7|\0-\37|;
 $_=unpack('B*',$_);
 s/000(.....)/$1/g;
 $l=length;
 $_=substr($_,0,$l & ~7) if $l & 7;
 $_=pack('B*',$_);

 my

($srv_id,$file_id,$usr_id,$dx,$id,$dmode,$speed,$i1,$i2,$i3,$i4,$expire)
= unpack(“SLLSA12ASC4L”, $hce->hce_block_decrypt($_) );
$dx=sprintf("%05d",$dx);
$speed = $speed.“k” if $speed;

if($r->remote_addr !~ /^$i1.$i2./)

{

$r->internal_redirect("/error_wrong_ip.html");

}

#elsif($expire<time)
if($expire<time)
{
$r->internal_redirect("/error_expired.html");
}
elsif(!-f “$upload_dir/$dx/$id”)
{
$r->internal_redirect("/error_nofile.html");
}
else
{
$r->header_out(“Content-Disposition”,“attachment”);

$r->internal_redirect("/download_$dmode/$dx/$id?id=$file_id&usr=$usr_id&speed=$speed&".$r->args);
}

 return OK;

}

1;