Questions about Internal named location

Rob Schultz rschultz7 at gmail.com
Fri Jul 30 23:26:42 MSD 2010


Hi, 

On Jul 30, 2010, at 8:31 PM, heimdull wrote:

> 
> index.php is displayed in the browser correctly so my question is why
> does the @www location not correctly handle the php file?
> 
its because index.php is a real file. It never gets passed off to @www. try_files is for testing real files on the filesystem. And returns that url if it is successful. If it is unsuccesful it is passed off to @www. 

> This all started when I tried to setup one nginx server that has
> multiple php sites under one url that needs a alias for the other sites.
> Something like this:
> 
> root /var/www/somesite;
> 
> location / {
>    index.html index.php;
> }
> location /wordpress {
>    alias /var/www/wordpress;
>    try_files $uri $uri/ @wordpress;
> }
> .... 

from the wiki http://wiki.nginx.org/Wordpress
might try this format
location /wordpress {
  try_files $uri $uri/ /wordpress/index.php?q=$uri&args;
}

and then have your normal php location block for fastcgi settings. 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nginx.org/pipermail/nginx/attachments/20100730/aa8a0e82/attachment.html>


More information about the nginx mailing list