PHP can't run under alias folder

edogawaconan nginx-forum at nginx.us
Sat Jul 18 19:37:18 MSD 2009


e123e123e123 Wrote:
-------------------------------------------------------
> another question ,
> 
> using 'alias' or 'root' is bestter ? or all is
> same ?

location /myalias {
  root /path/to;
}
the directory name in filesystem must be same as the one specified in location (in this case /path/to/myalias)

you can't make it work if you want location /anotheralias mapped to /path/to/myalias (must be /path/to/anotheralias) but you can do

location /anotheralias {
  alias /path/to/myalias;
}

But you must be careful when dealing with alias. Especially if you want to combine alias with try_files

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,4151,4193#msg-4193






More information about the nginx mailing list