• 空格:默认匹配,普通匹配
location / { 
    root /home;
}
  • =:精确匹配
location = /imooc/img/face1.png { 
    root /home;
}
  • -*:匹配正则表达式,不区分大小写
#符合图片的显示 location ~ \.(GIF|jpg|png|jpeg) { 
    root /home;
}
  • 〜:匹配正则表达式,区分大小写
#GIF必须大写才能匹配到 
location〜\.(GIF|jpg|png|jpeg) {
    root /home;
}
  • ^〜:以某个字符路径开头
location ^~ /test/img {
    root /home
}

相关文章:

  • 2022-12-23
  • 2021-12-03
  • 2021-08-18
  • 2022-01-10
猜你喜欢
  • 2018-10-24
  • 2021-07-15
  • 2021-12-27
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案