Nginx feature request

Hendrik Hardeman hendrik.hardeman at hotmail.com
Sun Feb 10 23:19:03 MSK 2008


Manlio,

Thanks a lot for your thoughts. I will look into your suggestions for implementing points 1 and/or 2 below.

As for scripting, for this particular purpose (serving static files) I don't require any scripting support. So adding Perl, or any other language for that matter, on top would be overkill.

To be frank, I'm personally also not a big fan of Perl. I'd prefer Python over Perl (I'm sorry about that :-).
Embedded LUA – anything else with the smallest possible overhead - could be nice though for some purposes.

For dynamic content I myself use Nginx upstream to several purpose-written asynchronous servers, written in Python on top of the libevent module (http://www.monkey.org/~provos/libevent/). I use Libevent as the actual server engine (probably quite close in performance to Nginx) which takes care of receiving / sending. I don't even bother about FastCGI. Each Python server listens on a particular port (behind Nginx upstream), is written to handle particular requests and has only the Python code required for that to keep overhead as small as possible.

I also use SSI wherever possible - I wish Nginx had a few more options in this area.

By pregenerating static files with content that should become available only after a certain time I can exploit Nginx even better - that is, if one day it has the feature I propose in this thread !

Hope this provides a better insight into my reasoning for proposing a filetime check option / directive.


Hendrik







> Date: Sun, 10 Feb 2008 20:16:58 +0100
> From: manlio_perillo at libero.it
> To: nginx at sysoev.ru
> Subject: Re: Nginx feature request
> 
> Hendrik Hardeman ha scritto:
> > Manlio,
> > 
> > Thanks for the suggestion, but when I propose this feature, it's exactly 
> > because I want to *avoid* something on top of Nginx (whether Perl, 
> > Python, PHP or anything else) !
> > 
> 
> Well, you need scripting support, so I don't understand why you should 
> avoid to use Perl.
> 
> nginx scripting module is very limited, and Igor has expressed 
> intentions to improve it.
> 
> Maybe a better language to embed in nginx is LUA, but this is another 
> question.
> 
> 
> > My need is very simple. All I want is to be able to disallow Nginx to 
> > serve certain files based on filetime. This could be done in two ways:
> > 
> > 1.
> > A directive which is off by default but which can be switched on in any 
> > of the standard places - most likely place would be in 'location'. Let 
> > me tentatively name this directive 'filetime_check'. 
> >
> 
> This should be easy to implement with a post access handler module, as 
> an example.
> 
> 
> > 2.
> > Independent from the above, it might be useful to be able to access the 
> > filetime of requested file for defining rewriting rules or for ssi. This 
> > could either be through a variable or through a function:
> > 
> > if ($date_gmt < fct($request_filename)) {do something, e.g. return 403;}
> > 
> 
> This too is easy to implement patching the rewrite module, but nginx 
> will not be able to do the comparison (it only support boolean and regex 
> opoerators).
> 
> Better to add a condition that will return true if the last modification 
> time is in the future.
> 
> 
>  > [...]
> 
> 
> 
> Manlio Perillo
> 

_________________________________________________________________
Post free property ads on Yello Classifieds now! www.yello.in
http://ss1.richmedia.in/recurl.asp?pid=219
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nginx.org/pipermail/nginx/attachments/20080211/3051e477/attachment.html>


More information about the nginx mailing list