Nginx Location root 与alias

 location ^~/img/ {
           alias html/images/;
          #  root html/images;
        }

alias 定义目录别名,访问/img/目录里面的文件时,ningx会自动去html/images目录找文件;路径后边必须加上“/";

root 定义顶层目录,访问/img/目录里面的文件时,ningx会自动去html/images/img目录找文件

猜你喜欢

转载自sants.iteye.com/blog/2278883