location 前缀


没有前缀               匹配以指定模式开头的location


=                          精准匹配,不是以指定模式开头


~                          正则匹配,区分大小写


~*                         正则匹配,不区分大小写


^~                         非正则匹配,匹配以指定模式开头的location


location匹配顺序

  • 多个正则location直接按书写顺序匹配,成功后就不会继续往后面匹配
  • 普通(非正则)location会一直往下,直到找到匹配度最高的(最大前缀匹配)
  • 当普通location与正则location同时存在,如果正则匹配成功,则不会再执行普通匹配
  • 所有类型location存在时,“=”匹配  >  “^~”匹配  >  正则匹配  >  普通(最大前缀匹配)

location匹配路径

alias路径在匹配后直接替换,root路径在匹配后追加到location匹配到的路径之后

Nginx location 正则篇的更多相关文章

  1. nginx location正则写法

    nginx location正则写法 一个示例: location = / { # 精确匹配 / ,主机名后面不能带任何字符串 [ configuration A ] } location / { # ...

  2. nginx location正则写法(转载)

    nginx location正则写法 一个示例: location = / { # 精确匹配 / ,主机名后面不能带任何字符串 [ configuration A ] } location / { # ...

  3. nginx location正则

    nginx location正则写法 一个示例: location = / { # 精确匹配 / ,主机名后面不能带任何字符串 [ configuration A ] } location / { # ...

  4. nginx location 正则匹配

    nginx 统计语句1.根据访问IP统计UV awk '{print $1}' access.log|sort | uniq -c |wc -l2.统计访问URL统计PV awk '{print $7 ...

  5. 【转】Nginx location写法

    转自:https://www.cnblogs.com/IPYQ/p/7889399.html nginx location正则写法 location = / { # 精确匹配 / ,主机名后面不能带任 ...

  6. Nginx location 配置用法及正则例子

    Nginx location 配置语法     1. location [ = | ~ | ~* | ^~ ] uri { ... }     2. location @name { ... }   ...

  7. nginx location 知识知多少

    写在之前 众所周知 nginx location 路由转发规则多种多样,尤其是 [ = | ~ | ~* | ^~ ] 这些前缀是什么意思.root 与 alias 是否可以区分开,nginx 作为反 ...

  8. Nginx location 匹配顺序整理

    Nginx location模块整理 具体的Nginx安装就不在这里描述了,这里只是为了对location的描述 Nginx环境 a. 查看当前系统cat /etc/redhat-release [r ...

  9. Nginx Location配置总结

    Nginx Location配置总结 语法规则: location [=|~|~*|^~] /uri/ { - }= 开头表示精确匹配^~ 开头表示uri以某个常规字符串开头,理解为匹配 url路径即 ...

随机推荐

  1. 早上一起来,就看到朋友圈发这个,慌的一 B

    早上一起来,就看到朋友圈发这个,慌的一 B,也不知道是真是假- 图中的 c 表示已被确认,大家可以看到各个大厂真的是在大幅度裁员. 不知道明年的情况会如何,网上看到过一句话:2019 年也许是这 10 ...

  2. js模块化世界

    前言 我们经常见到 一些这样的写法,require('xxx').import xx from '../components/data'.export const data....也听见一些这样的说法 ...

  3. 如何查杀stopped进程

    在Linux系统下面,top命令可以查看查看stopped进程.但是不能查看stopped进程的详细信息.那么如何查看stopped 进程,并且杀掉这些stopped进程呢? ps -e j | gr ...

  4. rs485引脚定义

    转自:http://blog.chinaunix.net/uid-9688646-id-3275796.html rs485有两种,一种是半双工模式,只有DATA+和DATA-两线,另一种是全双工模式 ...

  5. PHP 5.0~5.6 各版本兼容性的 cURL 文件上传

    不同版本PHP之间cURL的区别 PHP的cURL支持通过给CURL_POSTFIELDS传递关联数组(而不是字符串)来生成multipart/form-data的POST请求. 传统上,PHP的cU ...

  6. Python——模块——随机模块

    1.引用模块 import random 2.随机整数 random.randint(a,b) 3.随机浮点数 random.uniform(a,b) 4.从列表中随机取元素 random.choic ...

  7. 爬虫简介与request模块

    一 爬虫简介 概述 近年来,随着网络应用的逐渐扩展和深入,如何高效的获取网上数据成为了无数公司和个人的追求,在大数据时代,谁掌握了更多的数据,谁就可以获得更高的利益,而网络爬虫是其中最为常用的一种从网 ...

  8. Qt QWidget

    原文: https://www.cnblogs.com/muyuhu/archive/2012/10/26/2741184.html QWidget 类代表一般的窗口,其他窗口类都是从 QWidget ...

  9. HTTP 404 Not Found Error with .woff or .woff2 Font Files

      如果是 ERR_ABORTED 404 (Not Found) WOFF2,则有可能是文件不存在

  10. radio,check美化

    单选框与复选框原生控件美化有多种解决方案,现在采用经典的input+label的方式自己实现一种 思路: input 和label 通过id和for属性关联,点击label时,input选中状态改变 ...