try_files breaking index

Igor Sysoev igor at sysoev.ru
Fri Dec 11 10:35:39 MSK 2009


On Fri, Dec 11, 2009 at 12:56:11AM -0200, Marcos Neves wrote:

> I can access my site using /index.php?q=node/1 or /?q=node/1
> 
> When I add the code below, /?q=node/1 stop working:
> 
>     location / {
>       index index.php index.htm index.html;
>       try_files $uri /_cache$uri /index.php;
>     }
> 
> why?

You should add a directory test:

-       try_files $uri /_cache$uri /index.php;
+       try_files $uri $uri/ /_cache$uri /index.php;


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



More information about the nginx mailing list