Skip to content

eosforce/resty-gate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

resty-gate

An API Gateway based on OpenResty.

Features

  • HTTPS 到 HTTP 代理, 使用 let's encrypt 证书.
  • 每秒请求数限制.
  • JWT 鉴权.
  • upstream 负载均衡.

Install Deps

  • opm --cwd get openresty/lua-resty-limit-traffic
  • opm --cwd get SkyLothar/lua-resty-jwt

Run

  • openresty -p . -c conf/nginx.conf

Let's Enctrypt 生成证书

TEST

JWT Test

# apt-get install httpie || brew install httpie
$ http --print HBhb localhost/verify/ "Authorization:Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJmb28iOiJiYXIifQ.dtxWM6MIcgoeMgH87tGvsNDY6cHWL6MGW4LeYvnm1JA"
# token as url argument
$ http --print HBhb localhost/verify/?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJmb28iOiJiYXIifQ.dtxWM6MIcgoeMgH87tGvsNDY6cHWL6MGW4LeYvnm1JA
# token as cookie
$ http --print HBhb localhost/verify/ "Cookie:token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJmb28iOiJiYXIifQ.dtxWM6MIcgoeMgH87tGvsNDY6cHWL6MGW4LeYvnm1JA"

About

An API Gateway based on OpenResty

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages