server{

listen 80;

server_name localhost;

location / {

root /home/img;

}

location /img{

root /home;

}

#使用别名访问静态资源

location /static {

#root /home/img;

alias /home/img;

}

}