• 空格:默认匹配,普通匹配 ```shell location / { root /home; }
  1. - =:精确匹配
  2. ```shell
  3. location = /imooc/img/face1.png {
  4. root /home;
  5. }
  • ~*:匹配正则表达式,不区分大小写 ```shell

    符合图片的显示

    location ~* .(GIF|jpg|png|jpeg) { root /home; }
  1. - ~:匹配正则表达式,区分大小写
  2. ```shell
  3. #GIF必须大写才能匹配到
  4. location ~ .(GIF|jpg|png|jpeg) {
  5. root /home;
  6. }
  • ^~:以某个字符路径开头 ```shell location ^~ /imooc/img { root /home; }

```