rewrite help needed.

Maxim Dounin mdounin at mdounin.ru
Wed Aug 26 21:57:21 MSD 2009


Hello!

On Wed, Aug 26, 2009 at 05:44:46PM +0400, Igor Sysoev wrote:

[...]

> > >    location /blog/ {
> > >        try_files  $uri  $uri/  /index.php;
> > >    }
> > >
> > >    location ~ \.php$ {
> > >        include /etc/nginx/fastcgi_params;
> > >        fastcgi_pass 127.0.0.1:9000;
> > >    }
> > >
> > >  
> > Thanks Igor for your super fast response.
> > 
> > I should have mentioned that I'm on ubuntu and therefore nginx 0.5.33  
> > !  No try-files.
> > 
> > So I must either compile nginx on (unfamilar) ubuntu, or work round the 
> > missing try-files.
> 
>     location /blog/ {
>         error_page  404 = /index.php;
>     }
> 
>     location ~ \.php$ {
>         include /etc/nginx/fastcgi_params;
>         fastcgi_pass 127.0.0.1:9000;
>     }

BTW, isn't error_page fallback actually better in this case as it 
doesn't introduce race condition - while try_files do?

Maxim Dounin





More information about the nginx mailing list