07nginxLocation之正则匹配

mac2022-06-30  84

一: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 

  

转载于:https://www.cnblogs.com/hgj123/p/4250667.html

相关资源:JAVA上百实例源码以及开源项目
最新回复(0)