Toggle navigation
Toggle navigation
This project
Loading...
Sign in
ops
/
yoho-ansible-roles
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
chunhua.zhang
6 years ago
Commit
a9af74ab70120e0d1846640f83321ee5092f083f
1 parent
1db71264
add
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
roles/openresty/files/java-nginx-config/nginx/conf/lua/limit_api_flow.lua
roles/openresty/files/java-nginx-config/nginx/conf/lua/limit_api_flow.lua
View file @
a9af74a
...
...
@@ -84,11 +84,7 @@ end
--check is in white ip list
function
is_white
()
-- we must ignore mthod : app.graphic.img. this is app toast for user verified
local
method
=
http_request
.
get_method
()
if
method
and
method
==
"app.graphic.img"
then
return
true
end
if
limit_ip_config
then
local
white_ips_length
=#
limit_ip_config
.
white_ips
...
...
@@ -107,6 +103,13 @@ end
----- check weather ip is in black list
--- be careful when change response(body & header). APP need those to pop up verify toast
function
check_malIp
()
-- we must ignore mthod : app.graphic.img. this is app toast for user verified
local
method
=
http_request
.
get_method
()
if
method
and
(
method
==
"app.graphic.img"
or
method
==
"app.graphic.verify"
)
then
return
true
end
local
cache
=
lua_context
.
mal_ip_cache
local
ip
=
ngx
.
var
.
real_ip
local
exist
=
cache
:
get
(
"yh:mip:"
..
ip
)
...
...
Please
register
or
login
to post a comment