-
Notifications
You must be signed in to change notification settings - Fork 1.2k
访问指定目录时 301 重定向到源站端口是什么原因 #419
-
问题描述
在访问指定目录:/myExp,/AddExp时,出现301错误,并且在更新了waf后无法恢复,以下是waf设置,相关证据,访问路径
image
image
image
image
复现方法
由于此问题的独立性,此问题貌似仅能在我的服务器上复现
期望的结果
修复此问题
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 1
又有人遇到这个问题了,附一个解决方案,实际还是要改上游的 nginx,跟雷池无关:https://segmentfault.com/a/1190000020521708
Replies: 3 comments 2 replies
-
我是不理解,我以为是我的php写的有问题,他怎么能301跳转呢,我排查了半个小时发现此问题出在waf上
Beta Was this translation helpful? Give feedback.
All reactions
-
我好想知道问题所在了,我的源url是:
http://slaspi.xxxxxx.cn:3656/Event/addEscape/FacilityGuard-Escape?userid=xxxxxxxxx@steamscape=1
请看?号前面并没有 / 所以,nginx会尝试通过301修正此url为:
http://slaspi.xxxxxx.cn:3658/Event/addEscape/FacilityGuard-Escape/?userid=xxxxxxxxx@steamscape=1
但上述修正恰恰返回到了源站
Beta Was this translation helpful? Give feedback.
All reactions
-
非预期的 301 重定向基本都是后端服务的逻辑,和 waf 无关。最常见的是 nginx 自动添加 / ,还有一种是填错协议结果后台 http 301 到 https。
问题似乎解决了,issue 关闭。
Beta Was this translation helpful? Give feedback.
All reactions
-
为方便大家排查,转成 discussion 〜
Beta Was this translation helpful? Give feedback.
All reactions
-
又有人遇到这个问题了,附一个解决方案,实际还是要改上游的 nginx,跟雷池无关:https://segmentfault.com/a/1190000020521708
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 1