2017-02-16 90 views
4

我正在寻找一个为反向代理进行认证/访问控制的模块(最好为nginx)。此模块应该做的:用于反向代理的认证/访问控制模块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. 

似乎OpenRestynginx可以做的工作。这里有一个articlenginx上讨论Lua的访问控制。这是给我的印象是,文件的片段可以以进行访问(access_by_lua_file)执行的示例(nginx and Lua):

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; 
    } 

    } 

我新的反向代理访问控制。任何想法是赞赏。

回答