nginx-0.7.31

Igor Sysoev is at rambler-co.ru
Tue Jan 20 13:14:59 MSK 2009


On Tue, Jan 20, 2009 at 01:41:03AM -0800, mike wrote:

> oh i see in the russian docs
> 
> would this be identical to below?
> 
> try_files $uri /wordpress/index.php?q=$request_uri;

If you do not need PATH_INFO, then:

location / {
    try_files      $uri  @wordpress;
}

location ~ \.php {
    try_files      $uri  @wordpress;

    fastcgi_pass   ...;

    fastcgi_param  SCRIPT_FILENAME  /path/to$fastcgi_script_name;
    fastcgi_param  QUERY_STRING     $query_string;  # or $args

    # other fastcgi_param's
}

location @wordpress {
    fastcgi_pass   ...;

    fastcgi_param  SCRIPT_FILENAME  /path/to/index.php;
    fastcgi_param  QUERY_STRING     q=$request_uri;

    # other fastcgi_param's
}

> and is try_files now the recommended method instead of using the
> error_page 404? is it faster/less intensive?
> 
> On Tue, Jan 20, 2009 at 1:17 AM, Igor Sysoev <is at rambler-co.ru> wrote:
> > On Tue, Jan 20, 2009 at 01:10:07AM -0800, mike wrote:
> >
> >> Would it make sense for wordpress now instead of doing this:
> >>
> >> error_page 404 = /wordpress/index.php?q=$request_uri;
> >>
> >> To do something with a try_files directive? Now that it is there I
> >> want to try to take advantage of it :)
> >
> > Yes.
> >
> >
> > --
> > Igor Sysoev
> > http://sysoev.ru/en/
> >
> >

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





More information about the nginx mailing list