NGINX Reverse Proxy Authentication / Access Control Module

I am looking for a module that performs authentication / access control for a reverse proxy (preferred nginx). This module should do:

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. 

It seems that OpenRestys nginxcan complete the task. The following is an article on access control using Luaon nginx. Here is an example ( nginx and Lua) that gives the impression that a file fragment can be made for access ( 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;
    }

  }

I am new to reverse proxy access control. Any thought is appreciated.

+4
source share

Source: https://habr.com/ru/post/1669897/


All Articles