Nginx Location 及动静分离

一.Nginx Locationhtml

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 二.动静分离linux

动静分离就是将nginx须要处理的东西分开放置处理。(参考Nginx反向解析)nginx

113中共享图片文件vim

[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 nfsspa

[root@localhost images]# ls      //在images中上传测试图片
linux11.jpg3d

111中挂载目录rest

[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.jpghtm

在index.html中引用图片

用浏览器测试

 

测试成功

相关文章
相关标签/搜索