location /xxx {
alias /data/work/xxx/h5;
index index.html index.htm;
}
location / {
root /data/work/www/h5;
index index.html index.htm;
}
注意:
1,location /xxx { 沒(méi)有等號(hào)“=”
2,location /xxx { 寫(xiě)在 location / { 前面,否則匹配了/就不再往下走
3,/xxx特殊地址時(shí),使用alias而非root,如果使用root會(huì)又增加/xxx地址,變成/data/work/xxx/h5/xxx