就是前端在访问一些静态资源的时候,可以直接通过nginx去访问,不需要请求后端服务
(1)在webapps文件夹中创建 /data/image/01.jpg /data/www/a.html
(2)配置Nginx配置文件
server{listen 80;server_name 192.168.17.129;location /image/ {root /data/;autoindex on;}location /www/ {root /html;index index.html index.htm;}}
访问 192.168.17.129/image/01.jpg 显示图片
访问 192.168.17.129/image/ 显示如下,因为配置了 autoindex
