An API Gateway based on OpenResty.
- HTTPS 到 HTTP 代理, 使用 let's encrypt 证书.
- 每秒请求数限制.
- JWT 鉴权.
- upstream 负载均衡.
opm --cwd get openresty/lua-resty-limit-traffic
opm --cwd get SkyLothar/lua-resty-jwt
openresty -p . -c conf/nginx.conf
# 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"