他们都可以用来指定请求资源的路径
root:
location /wap/ {root /wap_web/static;}
假设访问的是http://localhost:8080/wap/test.html
那它实际访问的资源路径是:wap_web/static/wap/test.html
alias:
location /wap/ {alias /wap_web/static/; }
实际访问的资源路径是:/wap_web/static/test.html
alias指定的路径是location的别名,不管location的值怎么写,资源的 真实路径都是 alias 指定的路径
alias 只能作用在location中,而root可以存在server、http和location中。