美文网首页
nginx匹配规则

nginx匹配规则

作者: sunland_0416 | 来源:发表于2020-12-17 17:21 被阅读0次
表达式 含义
= 严格匹配。如果请求匹配这个location,那么将停止搜索并立即处理此请求
~ 区分大小写匹配(可用正则表达式)
~* 不区分大小写匹配(可用正则表达式)
!~ 区分大小写不匹配
!~* 不区分大小写不匹配
^~ 如果把这个前缀用于一个常规字符串,那么告诉nginx 如果路径匹配那么不测试正则表达式
location ^~ /sta/ {  
   alias /usr/local/nginx/html/static/;  
}
location ^~ /tea/ {  
   root /usr/local/nginx/html/;  
}

alias 请求:http://test.com/sta/sta1.html; 实际访问:/usr/local/nginx/html/static/sta1.html 文件
root 请求:http://test.com/tea/tea1.html;实际访问:/usr/local/nginx/html/tea/tea1.html 文件

相关文章

  • Nginx location的正则匹配

    Nginx location的正则匹配 Nginx正则匹配的匹配规则

  • nginx 配置静态文件

    [nginx try_files的理解] Nginx location的匹配规则 location 匹配优先级 示例

  • nginx 正则和路由规则

    nginx 参考 location uri匹配规则 语法规则: location [=||*|^~] /uri/ ...

  • nginx重写规则

    nginx重写规则 nginx rewrite 正则表达式匹配 大小写匹配 ~ 为区分大小写匹配 ~* 为不区分大...

  • Nginx 匹配规则

    Nginx 内核源码解析 nginx location 练习 Nginx location 配置踩坑过程分享ngi...

  • nginx匹配规则

    表达式含义=严格匹配。如果请求匹配这个location,那么将停止搜索并立即处理此请求~区分大小写匹配(可用正则表...

  • Nginx 匹配规则

    无 :默认匹配,普通匹配 = :精确匹配 ~* :匹配正则表达式,不区分大小写 ~ :匹配正则表达式,区分大小写 ...

  • nginx匹配规则说明以及匹配的优先级

    location 匹配规则 语法规则 前缀匹配时,Nginx 不对 url 做编码,因此请求为 /static/2...

  • nginx基础知识

    nginx主配置文件 nginx.conf 配置文件结构如下: location匹配规则 语法规则location...

  • Nginx Location

    Nginx Location规则 语法规则: 首先精确匹配 =-》其次以xx开头匹配^~-》然后是按文件中顺序的正...

网友评论

      本文标题:nginx匹配规则

      本文链接:https://www.haomeiwen.com/subject/tzezgktx.html