首页 > 其他 > 详细

Nginx Location 及动静分离

时间:2019-09-16 11:01:11      阅读:121      评论:0      收藏:0      [点我收藏+]

一.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中引用图片

用浏览器测试

技术分享图片

 

测试成功

 

Nginx Location 及动静分离

原文:https://www.cnblogs.com/zhiyuan-yu/p/11525898.html

(1)
(1)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!