nginx location 匹配规则
来源:互联网 发布:cimatrone11编程视频 编辑:程序博客网 时间:2024/05/22 06:19
序
nginx
的location
是nginx
中负责请求的匹配和分发的重要组件之一,本文简要介绍了location
的写法和匹配规则,作为记录,方便查阅
语法
location [ = | ~ | ~* | ^~ ] uri { ... }location @name { ... }
- =: 精确匹配
- ~: 正则表达式匹配
- ~*: 大小写不敏感正则匹配
- ^~:不继续进行正则匹配的标记,前缀匹配
- 空白:前缀匹配
- @:内部跳转名字标记
匹配顺序
类别间匹配顺序
- 精确匹配(=)
- 不继续进行正则匹配的标记的前缀匹配(^~)
- 正则匹配
- 前缀匹配
类别内匹配顺序
前缀匹配
前缀匹配遵循最大前缀匹配原则
举个例子
location /hello/worldlocation /hello
当访问/hello/world/readme.html
时,匹配location /hello/world
正则匹配
按照配置文件的书写顺序,匹配第一个匹配的正则location
0 0
- nginx location匹配规则
- Nginx location 匹配规则
- nginx location匹配规则
- nginx location匹配规则
- nginx location匹配规则
- NGINX location 匹配规则
- nginx location匹配规则
- nginx location匹配规则
- nginx location匹配规则
- nginx location匹配规则
- nginx location匹配规则
- nginx location 匹配规则
- nginx location 匹配规则
- nginx location 匹配规则
- nginx location匹配规则
- nginx location 匹配规则
- nginx location匹配规则
- nginx location 匹配规则
- VPN Azure Service 配置
- 单例模式的结构
- Android牛人启航博客地址
- [Oracle]搞懂Oracle字符集
- 进入Material Design时代
- nginx location 匹配规则
- 《剑指offer》数值的整数次方
- java使用https请求
- XCode安装插件以及手误选择了「Skip Bundle」后需要重新允许「Load Bundle」的解决方法
- hibernate 笔记(1)
- ExecutorService-10个要诀和技巧
- Fiddler手机抓包环境搭建及可能问题解决
- 获取短信验证码倒计时效果
- 浅谈谷歌全新设计理念Material design