1. root指令
location /test {
root d:/www;
index index.html;
}
http://localhost/test/index.html 将会映射到 d:/www/test/index.html
2. alias指令
location /test {
alias d:/www;
index index.html;
}
http://localhost/test/index.html 将会映射到 d:/www/index.html
完整示例:GitHub
PS:本文使用的是nginx-1.10.2
网友评论