7 messages in ru.sysoev.nginxUnusual requirement using perl?
FromSent OnAttachments
Kingsley ForemanOct 30, 2007 7:34 am 
Igor SysoevOct 30, 2007 10:07 am 
Kingsley ForemanOct 30, 2007 10:17 am 
Igor SysoevOct 31, 2007 12:34 am 
Kingsley ForemanOct 31, 2007 12:45 am 
Igor SysoevOct 31, 2007 12:58 am 
Kingsley ForemanOct 31, 2007 2:25 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Unusual requirement using perl?Actions...
From:Kingsley Foreman (king@public.gmane.org)
Date:Oct 30, 2007 7:34:29 am
List:ru.sysoev.nginx

I have an unusual requirement for a poject im working on.

What I need to do is somehow make it so that an ip address is able to hit a folder but anyone not on that address will get a 404 or 403 message.

Im not much of a perl programmer however what i need it to do is this

_______________________________________________________________________________________ $ip = $r->remote_addr ; $request = "/htdocs/111222333444-123456789/blah/"; # this would be the $r->uri i think $ip =~ s/\.//g;

$request =~ /\/htdocs\/([0-9]+)-([0-9]+)\/blah\//; # matches the 111222333444 and 123456789 in the request if ($ip == $1){ print "allow"; # allow it to open the file/folder } else { print "404"; # send a 404 or 403 message to the client }

_______________________________________________________________________________________ I hope this example sort of shows what I need to happen, however I have no idea how to use the perl-embed module to make it work.

Kingsley Foreman Technical Leader Content Services / Content Management Group

============================================= Internode Systems Pty Ltd

PO Box 284, Rundle Mall 5000 Level 3, 132 Grenfell Street, Adelaide 5000 Phone: +61 8 8228 2978 Fax: +61 8 8235 6978 Web: http://www.internode.on.net http://games.internode.on.net =============================================