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.
    
    注意:
          优化等及相对于相同的匹配
  • 相关阅读:
    Java1:Chapter3
    css3圆角和阴影效果
    css3兼容各版本浏览器前缀
    DOM
    数组方法
    Math方法
    JSON
    字符串方法
    日期对象
    定时器
  • 原文地址:https://www.cnblogs.com/hanxiaohui/p/8488584.html
Copyright © 2011-2022 走看看