码迷,mamicode.com
首页 > 其他好文 > 详细

07 nginx Location之正则匹配

时间:2015-01-26 18:41:54      阅读:190      评论:0      收藏:0      [点我收藏+]

标签:

一:Location之正则匹配

再来看,正则也来参与.

location / {

            root   /usr/local/nginx/html;

            index  index.html index.htm;

        }

 

location ~ image {

           root /var/www/image;

           index index.html;

}

 

如果我们访问  http://xx.com/image/logo.png

此时, “/” 与”/image/logo.png” 匹配

同时,”image”正则 与”image/logo.png”也能匹配,谁发挥作用?

正则表达式的成果将会使用.

 

图片真正会访问 /var/www/image/logo.png 

  

07 nginx Location之正则匹配

标签:

原文地址:http://www.cnblogs.com/hgj123/p/4250667.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!