2017-02-16 89 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; 
    } 

    } 

我新的反向代理訪問控制。任何想法是讚賞。

回答