拦截静态页面
# 在配置文件(default或者自定义配置文件)加上如下内容
# 表示/helloWorld请求会被定义到/home/hello/helloWorld.html
...
location /helloWorld {
alias /home/hello/;
index helloWorld.html;
}
...
拦截静态资源
# css/js等静态资源请求会被拦截并转到/var/www路径下
location ~ .*\.(css|js|gif|jpg|png|bmp|swf|jpeg|ttf|ico|woff)$ {
root /var/www;
}