文件地址在nginx目录下aaa/bbb/index.html
server {
listen 83;
location /bbb {
proxy_cache off;
#相对于nginx配置文件路径,root可以在server块指定,作用范围不同
root aaa;
index index.html;
}
#location /xxx{
# `````
#}
}
此时的访问路径应该是http://localhost:83/bbb
响应的路径是/aaa/bbb目录下的index.html ,实际请求地址root会拼接匹配的url地址,区别于alias则相反
```
等价于
```
server {
listen 83;
location / {
proxy_cache off;
root aaa/bbb/;
index index.html;
}
}
此时的访问路径应该是http://localhost:83
响应的路径是/aaa/bbb目录下的index.html ,实际请求地址root会拼接匹配的url地址