gpt4 book ai didi

ruby-on-rails - 反向代理 NGINX 的认证/访问控制模块

转载 作者:数据小太阳 更新时间:2023-10-29 07:37:24 27 4
gpt4 key购买 nike

我正在寻找一个为反向代理执行身份验证/访问控制的模块(最好是 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 和 Lua),给我的印象是可以执行一段文件以进行访问(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;
}

}

我是反向代理访问控制的新手。任何想法都会受到赞赏。

最佳答案

这是一个有趣的 article在回答上述问题的 nginx 网站上。 https://www.nginx.com/blog/nginx-plus-authenticate-users/

关于ruby-on-rails - 反向代理 NGINX 的认证/访问控制模块,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42264984/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com