openresty
来源:互联网 发布:巨灵金融怎么查数据 编辑:程序博客网 时间:2024/03/29 01:09
下载安装
#wget https://openresty.org/download/ngx_openresty-1.7.10.1.tar.gz
#tar xf ngx_openresty-1.7.10.1.tar.gz
#cd ngx_openresty-1.7.10.1
#./configure --with-luajit
#make && make install
【location】
(1)=/ 和 /
location = / {
[configure A]
}
location / {
[configure B]
}
#curl http://localhost/ 匹配B
分析:本来精确匹配应该为A,但当访问http://localhost/时,默认访问网址为http://localhost/index.html,所以匹配为B
(2)=/index.html 和 /
location = /index.html {
[configure A]
}
location / {
[configure B]
}
#curl http://localhost/ 匹配A
(3)/xixi/ 与 ^~ /xixi/
location /xixi/ {
[configure A]
}
location ^~ /xixi/ {
[configure B]
}
报错:
nginx: [emerg] duplicate location "/xixi/" in /usr/local/openresty/nginx/conf/nginx.conf:58
分析:/xixi/与^~ /xixi/都属于普通字符匹配,属于重复配置
(4)~ /xixi/ 与 ^~ /xixi/
location ~ /xixi/ {
[configure A]
}
location ^~ /xixi/ {
[configure B]
}
#curl http://localhost/xixi/ 匹配B
分析:^~ /xixi/优先级大于正则 ~ /xixi/
#curl http://localhost/xixi
报错:404 Not Found
分析:错误日志显示xixi文件不存在
# tail -n5 logs/error.log
2017/02/17 23:19:52 [error] 9732#0: *118 open() "/usr/local/openresty/nginx/html/haha/xixi" failed (2: No such file or directory), client: 127.0.0.1, server: 192.168.204.131, request: "GET /xixi HTTP/1.1", host: "localhost"
(5)~ /xixi/ 与 /xixi/
location /xixi/ {
[configure A]
}
location ~ /xixi/ {
[configure B]
}
#curl http://localhost/xixi/ 匹配B
分析: ~/xixi/ 优先 /xixi/
(6)分析错误日志
2017/02/18 00:05:38 [error] 9987#0: *207 open() "/usr/local/openresty/nginx/html/haha/favicon.ico" failed (2: No such file or directory), client: 192.168.204.1, server: 192.168.204.131, request: "GET /favicon.ico HTTP/1.1", host: "192.168.204.131"
0 0
- openresty
- OpenResty
- openresty
- openresty
- openresty
- Openresty 安装
- 配置openresty
- 安装openresty
- 安装OpenResty
- openresty 简介
- openresty-redis
- 安装OpenResty
- openresty--安装
- openresty简记
- openresty学习
- openresty详解
- openResty-----安装
- OpenResty体系
- Java 递归删除文件
- 7.自定义Toast
- hdu 1087 Super Jumping! Jumping! Jumping!
- head first python 第三章
- POJ-2531
- openresty
- POJ-2533
- get_magic_quotes_gpc异常
- Android——PagerTabStrip和PagerTitleStrip异同
- POJ-2785
- POJ-3126
- 协方差矩阵的实例与意义
- JavaScript中,对this的简单记忆
- LeetCode:Single-Number