zoukankan      html  css  js  c++  java
  • location优先级

    • location优先级
    location优先级
    location /img     # 直接匹配
          location /img {
                index index.html
          }
    location = /img   # 精确匹配
          location = /img {
                index index.html
          }
    location ^~ /img  # 前缀匹配
          location ^~ /img/ {
                index index.html
          }
    location ~ /img     #区分大小写
    location ~* /img    #不区分大小写
          location ~* .(gif|jpg|jpeg)$ {
                index index.html
          }
    Let’s illustrate the above by an example:
    
    location = / {
        [ configuration A ]
    }
    
    location / {
        [ configuration B ]
    }
    
    location /documents/ {
        [ configuration C ]
    }
    
    location ^~ /images/ {
        [ configuration D ]
    }
    
    location ~* .(gif|jpg|jpeg)$ {
        [ configuration E ]
    }
    = 高于 ^~ 高于 ~ 高于 ~*
    
    The “/” request will match configuration A, the “/index.html” request will match configuration B, the “/documents/document.html” request will match configuration C, the “/images/1.gif” request will match configuration D, and the “/documents/1.jpg” request will match configuration E.
    
    注意:
          优化等及相对于相同的匹配
  • 相关阅读:
    三维dem
    geoserver 通过代码实现发布地图服务
    restful发布服务
    php防攻击
    redis主从复制
    redis虚拟内存
    redis 持久化
    lamp源码安装
    mysql优化
    php匿名函数与闭包函数
  • 原文地址:https://www.cnblogs.com/hanxiaohui/p/8488584.html
Copyright © 2011-2022 走看看