【发布时间】:2017-07-05 00:50:26
【问题描述】:
我正在寻找一个对反向代理进行身份验证/访问控制的模块(最好是nginx)。这个模块应该做:
1. user authentication using credential stored in database (such as postgres)
2. Monitoring the ongoing connection and take action if certain access credential is met. For example, time is expired
3. open source (allow customization) and nginx, ruby(rails) preferable.
似乎OpenResty 和nginx 可以完成这项工作。这是article 在nginx 上与Lua 谈论访问控制。这是一个示例 (nginx and Lua) 给我的印象是可以执行文件的 sn-p 以进行访问 (access_by_lua_file):
server {
listen 8080;
location / {
auth_basic "Protected Elasticsearch";
auth_basic_user_file passwords;
access_by_lua_file '../authorize.lua'; #<<<=====
proxy_pass http://elasticsearch;
proxy_redirect off;
}
}
我是使用反向代理进行访问控制的新手。任何想法表示赞赏。
【问题讨论】:
标签: ruby-on-rails ruby nginx lua reverse-proxy