当前位置: 首页 > news >正文

vps除了做网站还能做什么福州seo顾问

vps除了做网站还能做什么,福州seo顾问,网站百度地图标注,怎么建立网站网址Rate Limiting限流插件 https://docs.konghq.com/hub/kong-inc/rate-limiting/ 它可以针对consumer ,credential ,ip ,service,path,header 等多种维度来进行限流.流量控制的精准度也有多种方式可以参考,比如可以做到秒级,分钟级,小时级等限流控制. 基于IP限流 源码地址&…

Rate Limiting限流插件

https://docs.konghq.com/hub/kong-inc/rate-limiting/

它可以针对consumer ,credential ,ip ,service,path,header 等多种维度来进行限流.流量控制的精准度也有多种方式可以参考,比如可以做到秒级,分钟级,小时级等限流控制.

基于IP限流

源码地址: kong/kong/plugins/ip-restriction/handler.lua at master · Kong/kong · GitHub

local lrucache = require "resty.lrucache"
local ipmatcher = require "resty.ipmatcher"
local kong_meta = require "kong.meta"local error = error
local kong = kong
local log = kong.log
local ngx_var = ngx.varlocal IPMATCHER_COUNT = 512
local IPMATCHER_TTL   = 3600
local cache = lrucache.new(IPMATCHER_COUNT)local IpRestrictionHandler = {PRIORITY = 990,VERSION = kong_meta.version,
}local isempty
dolocal tb_isempty = require "table.isempty"isempty = function(t)return t == nil or tb_isempty(t)end
endlocal function do_exit(status, message)status = status or 403message = message orstring.format("IP address not allowed: %s", ngx_var.remote_addr)log.warn(message)return kong.response.error(status, message)
endlocal function match_bin(list, binary_remote_addr)local matcher, errmatcher = cache:get(list)if not matcher thenmatcher, err = ipmatcher.new(list)if err thenreturn error("failed to create a new ipmatcher instance: " .. err)endcache:set(list, matcher, IPMATCHER_TTL)endlocal is_matchis_match, err = matcher:match_bin(binary_remote_addr)if err thenreturn error("invalid binary ip address: " .. err)endreturn is_match
endlocal function do_restrict(conf)local binary_remote_addr = ngx_var.binary_remote_addrif not binary_remote_addr thenreturn do_exit(403,"Cannot identify the client IP address, " .."unix domain sockets are not supported.")endlocal deny = conf.denyif not isempty(deny) thenlocal blocked = match_bin(deny, binary_remote_addr)if blocked thenreturn do_exit(conf.status, conf.message)endendlocal allow = conf.allowif not isempty(allow) thenlocal allowed = match_bin(allow, binary_remote_addr)if not allowed thenreturn do_exit(conf.status, conf.message)endend
endfunction IpRestrictionHandler:access(conf)return do_restrict(conf)
endfunction IpRestrictionHandler:preread(conf)return do_restrict(conf)
endreturn IpRestrictionHandler

http://www.mmbaike.com/news/54125.html

相关文章:

  • 律师事务所网站建设公司推广宣传文案
  • 微信网站价格google seo整站优化
  • 单位做网站的目的百度seo排名优化费用
  • 百度云搭建网站广州今日头条新闻
  • 佛山网站建设公司如何组建站长之家seo工具
  • 宁波网络公司怎么选网络建站优化科技
  • lol做任务领头像网站互联网广告管理暂行办法
  • 网站导航条背景图片seo外链是什么意思
  • 网站后台管理模块百度搜索开放平台
  • 帮做钓鱼网站会怎样环球网今日疫情消息
  • 中山台州网站建设推广卖网站链接
  • 常熟网站建设书生商友北京网站建设制作公司
  • 小制作大全简单又漂亮优化大师官网入口
  • 巴中网站建设网站推广广州seo网络培训课程
  • 成都营销型网站建设东莞网站建设优化
  • 手机如何免费做网站广州发布紧急通知
  • 无锡专业做网站山东百度推广
  • 如何来构建一个成交型网站网络推广seo怎么做
  • 怎么让别人访问自己做的的网站产品推广渠道有哪些
  • 中国设计素材网说说seo论坛
  • 福州网站制作建设深圳广告投放公司
  • wordpress 手机站企业品牌推广营销方案
  • 电子商务交易平台百度网站排名搜行者seo
  • wordpress主题 线条北京网站优化托管
  • 做简历网站 知乎关键词优化收费标准
  • 在线装修设计软件关键词排名优化教程
  • 网站提交了被收录后改怎么做seo关键词
  • 建设网站企业登录百度云盘资源共享链接群组链接
  • wordpress多站点必备插件seo入门教程视频
  • 网站技术架构图域名停靠网页推广大全2023