Weird 0.8.11.1 connections spike
Igor Sysoev
is at rambler-co.ru
Mon Aug 31 14:38:05 MSD 2009
On Mon, Aug 31, 2009 at 06:36:24PM +1000, Jeff Waugh wrote:
> <quote who="Jeff Waugh">
>
> > set $wordpress_root /srv/wordpress/root;
>
> Should've mentioned:
>
> root /srv/example.com/root;
>
> > location / {
> > try_files $uri $uri/ @wordroot;
> > }
> >
> > location @wordroot {
> > internal;
> > root $wordpress_root;
> > index index.php;
> > try_files $uri $uri/ /index.php?q=$request_uri;
> > expires 5y;
> > }
>
> The point behind the above logic is to try and serve a file first from the
> domain's root (such as favicon.ico), then from the generic $wordpress_root
> for files provided by the WordPress distribution (such as everything under
> /wp-includes as with the .js example in the debugging), then finally pass
> anything else to PHP.
Probably, this is the problem, I will investigate this type of configuration.
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.
--
Igor Sysoev
http://sysoev.ru/en/
More information about the nginx
mailing list