惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Stack Overflow Blog
Stack Overflow Blog
云风的 BLOG
云风的 BLOG
G
Google Developers Blog
J
Java Code Geeks
C
Check Point Blog
Last Week in AI
Last Week in AI
Microsoft Azure Blog
Microsoft Azure Blog
Blog — PlanetScale
Blog — PlanetScale
月光博客
月光博客
Vercel News
Vercel News
The GitHub Blog
The GitHub Blog
L
LangChain Blog
有赞技术团队
有赞技术团队
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园 - 司徒正美
IT之家
IT之家
Martin Fowler
Martin Fowler
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
T
Tailwind CSS Blog
U
Unit 42
Jina AI
Jina AI
Microsoft Security Blog
Microsoft Security Blog
I
InfoQ

NGINX

有用 Nginx UI 的朋友吗?这玩意是不是时不时将磁盘 IO 打满? fail2ban 保护 nginx 方案 麦当劳服务模式是 nginx,肯德基服务模式是 apache,这样理解对不对? oracleusa.ml 的实现原理 尝试自己配置转发后端请求的时候有个疑问 请教 Nginx 时完整的 SSL 刷新教程或者脚本 问问大家 nginx 日志流量分析用什么方案? nginx 二级目录反向代理是不是有先天缺陷? nginx rewrite 指令的问题 问个 nginx 配置问题 请问下为啥微信客户端访问到 nginx 没有参数了? 有兄弟们用 nginx proxy manager(或者其他图形化工具)来管理 nginx 反向代理的吗? 请问 Nginx 怎么添加 CORS 白名单? 使用 nginx 监听已被监听的端口, reload 不会失败, 但会导致其他配置不生效. nginx 如何获取/打印完整代理路径? Nginx 四层反代 QUIC 如何传递客户端 IP 关于 windows 下面重启之后 nginx 的问题 我是不是可以反向代理个 V2EX 网站? 用 nginx 做的 xai 的转发好像一直有问题 请教一个 Nginx 配置和浏览器强制 http 转 https 问题 nginx proxy manager ipv6 反代指向内网 ipv4 局域网地址,还可以这样操作🤔? 关于 Nginx 反向代理性能调优的问题,求指导🙏 nginx 配置根据请求头分发问题 用过 nginx-proxy-manager 请进, 咨询个问题. 我有一个端口转发问题,求大佬们协助 使用 Nginx 代理 Emby 服务器,浏览器可以访问但是客户端连不上 小白在使用 Nginx proxy manager 遇到问题,请大佬们指教。 请教下 nginx 反代配置 nginx 配置问题求解答 Nginx 流量异常,请大佬支招~
nginx 限流失败的奇怪问题
dunhanson · 2024-11-25 · via NGINX

问题描述

~/info 限流失败

~info 和~/info 都能匹配到值,$limit_key_pc_page_info 的值输出 page_info

为什么加/符号会影响限流?$limit_key_pc_page_info 里面有值

1 、nginx 配置

# 变量-URI
map $uri $limit_key_pc_page_info {
	~/info "page_info";
	#~info "page_info";
	default "";
}
limit_req_zone $limit_key_pc_page_info zone=limit_zone_pc_page_info:10m rate=1r/s;

server {
	listen 80;
	server_name www.dunhanson.com;
	charset utf-8;

	location / {
		# 限流
		limit_req zone=limit_zone_pc_page_info nodelay;
		proxy_pass http://www_dunhanson_com;
	}
}

server {
	listen 80;
	server_name test.dunhanson.com;
	charset utf-8;

	location / {
		default_type text/plain;
		return 200 "$uri $limit_key_pc_page_info";
	}
}

2 、测试效果

curl http://test.dunhanson.com/info-558860051.html

输出: /info-558860051.html page_info