Skip to content

Commit

Permalink
白名单只对uri做判断
Browse files Browse the repository at this point in the history
  • Loading branch information
loveshell committed Apr 7, 2015
1 parent 564979d commit ae8aa78
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ function whiteurl()
if WhiteCheck then
if wturlrules ~=nil then
for _,rule in pairs(wturlrules) do
if ngxmatch(ngx.var.request_uri,rule,"isjo") then
if ngxmatch(ngx.var.uri,rule,"isjo") then
return true
end
end
Expand Down

2 comments on commit ae8aa78

@fengdingbo
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里为啥是ngx.var.uri?而不是ngx.var.request_uri?如果nginx配置了rewrite,就获取不到真实的uri了,而是重定向之前的uri。

@loveshell
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

嗯,request_uri更合适些,这个大家可以随意diy。我当时是有种担心有人不了解情况配置不严格造成一些其他问题就直接写了uri。感谢提醒

Please sign in to comment.