nginx location块的配置方法

简单一句,root设置的是location匹配路径的查找目录,是从安装目录开始的!

比如

location / {

  root html;

}

匹配到/的时候是从nginx目录下的html目录里找

location /hello {

  root hello;

}

匹配到/hello是从nginx目录下的hello目录里找

你配对了吗?

原文地址:https://www.cnblogs.com/jingubang/p/5653403.html