location /test { alias /home/target/; index index.html; }
这样配置后,访问:html
xxx.com/test/index.htmlnginx
实际访问的服务器文件为:服务器
/home/target/index.htmlcode
location /test { root /home/target/; index index.html; }
这样配置后,访问:htm
xxx.com/test/index.htmlget
实际访问的服务器文件为:io
/home/target/test/index.htmlclass