variables in "include"
Marcus Clyne
maccaday at gmail.com
Tue Jul 21 02:13:53 MSD 2009
Michael Shadle wrote:
> i agree. i think there should be an htaccess on; type deal, and instead of going
>
> /
> /home
> /home/foo
> /home/foo/bar
> /home/foo/bar/foo.com
>
> in the search path, it should start in the document root. in php 5.3,
> they actually take the file path being requested, and then go
> backwards from there, down to the document root level.
>
> so
>
> http://foo.com/1/2/3/
>
> would chekc for
>
> /home/foo/bar/foo.com/1/2/3/
> /home/foo/bar/foo.com/1/2/
> /home/foo/bar/foo.com/1/
> /home/foo/bar/foo.com/
>
>
That would be overall less efficient, since if you had htaccess-like
files, you would always want to check the uppermost level (because it
might say to ignore htaccess files lower down). If it did, then you
will have checked lower-level htaccess files unnecessarily.
> maybe also have a cache and a configuration item of how much memory to
> dedicate to the cache...
>
> htaccess on;
> htaccess_file_name .htaccess;
> htaccess_cache_size shared:htaccess:10m;
> htaccess_cache_time 15s;
>
Wrt caching, any valid htaccess files would probably want to be cached
permanently until any files were htaccess updated (i.e. not re-read
after 15s of not reading as might be the case here). You'd only want to
stat the file, then only if it's changed, re-load the config. The
directive would then be less a cache time directive, but a 'don't stat
the file to see if it's changed within this time' directive.
Not sure if that's what you meant or not.
Obviously, you'd want to be statting/loading the file asynchronously, so
as not to block the server whilst it was happening.
You'd probably also want to specify which directives would be
permissible - perhaps on a module-by-module basis - which would only be
specifiable in the main config files.
Cheers,
Marcus.
More information about the nginx
mailing list