Weird 0.8.11.1 connections spike

Igor Sysoev is at rambler-co.ru
Mon Aug 31 18:08:06 MSD 2009


On Mon, Aug 31, 2009 at 11:54:18PM +1000, Jeff Waugh wrote:

> <quote who="Igor Sysoev">
> 
> > However, you try this:
> > 
> >    location / {
> >        root       /srv;
> >        try_files  /example.com/root$uri
> >                   /example.com/root$uri/
> >                   /wordpress/root/$uri
> >                   /wordpress/root/$uri/
> >                   /index.php?q=$request_uri;
> >    }
> >
> > The reason why try_files tests files only against "root" is because
> > there is also "alias" that can be not expressed via simple concatenation.
> 
> Hmm. This appears to make a ridiculous amount of sense. ;-)
> 
> Is it impossible to provide a fully qualified path to try_files? I can't do
> something like:
> 
>   root  /srv/example.com/root;
>   try_files /srv/example.com/root$uri
>             /index.php?q=$request_uri;
> 
> Will that check for /srv/example.com/root/srv/example.com/root$uri ?

Yes.

> How about $document_root in try_files?
> 
>   root  /srv/example.com/root;
>   set  $wordpress_root  /srv/wordpress/root;
>   try_files
>     $document_root$uri $document_root$uri/
>     $wordpress_root$uri $wordpress_root$uri/
>     /index.php?q=$request_uri;

Suppose configuration:

     location /one/ {
         alias  /path/two/;
         try_files  $uri  ...;
     }

Here try_files will test "/path/two/page" for "/one/page".
"$document_root$uri" will be /path/two/one/page".


-- 
Igor Sysoev
http://sysoev.ru/en/





More information about the nginx mailing list