一.Nginx Location
二.动静分离
动静分离就是将nginx需要处理的东西分开放置处理。(参考Nginx反向解析)
113中共享图片文件
[root@localhost ~]# mkdir /images
[root@localhost ~]# vim /etc/exports
[root@localhost ~]# cat /etc/exports
/images 192.168.200.111(ro)
[root@localhost ~]# systemctl restart rpcbind
[root@localhost ~]# systemctl restart nfs
[root@localhost images]# ls //在images中上传测试图片
linux11.jpg
111中挂载目录
[root@localhost ~]# mkdir /usr/local/nginx/html/images
[root@localhost ~]# mount 192.168.200.113:/images /usr/local/nginx/html/images
[root@localhost ~]# cd /usr/local/nginx/html/images
[root@localhost images]# ls
linux11.jpg
在index.html中引用图片
用浏览器测试
测试成功