使用nginx的身份验证方式

发布于 2025-02-02 20:26:15 字数 307 浏览 5 评论 0 原文

我是Nginx的新手,所以如果我的问题很明显,请忍受我。

我正在寻找将用户身份验证到NGINX服务器的方法。从我的研究中,我了解到有两个主要选择:

  1. End-user将包含私钥(例如在标题中)的请求发送到NGINX,NGNIX将身份验证发送到Auth Server,并且NGNIX获得答案如果用户进行身份验证。

  2. 第二个选项是nginx plus(一项要花钱的服务),而Nginx处理身份验证过程 - 如果有人知道此选项的开源版本,那将是最好的。

我真的很感谢您的帮助,谢谢大家!

I am new to Nginx, so please bear with me if my question is obvious.

I am looking for ways to authenticate users to the Nginx server. From my research I've understood there are two primary options:

  1. End-user sends a request that contains the private key (in the header for example) to Nginx, Ngnix sends the authentication to auth server and the Ngnix gets an answer if the user authenticated or not.

  2. The second option is, Nginx plus (A service that costs money), and the Nginx handles the authentication process - If someone knows an open-source version of this option it would be the best.

I would really appreciate the help, thank you all!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

長街聽風 2025-02-09 20:26:15
  1. 基本身份验证仍然存在, ://nginx.org/en/docs/http/ngx_http_auth_basic_module.html“ rel =“ nofollow noreferrer”> ngx_http_auth_auth_auth_basic_module 。不幸的是,NGINX本身实现的唯一算法是旧的和弱的Apache MD5,但是使用 GLIBC 基于主机系统,您还有其他选项。您可以找到更多详细信息在这里


  2. 您可以使用客户端证书对用户进行身份验证。互联网上有许多文章。这是 nofollow noreferrer“ nginx 从Google的第一个搜索结果页面中。

  3. 您可以使用指令来自 njs module作为auth stopation content hangler(而不是将auth请求定位到某些auth请求后端应用程序)。或者,您可以做这件事,您可能会发现使用Nginx和Nginx Plus 验证OAuth 2.0访问令牌非常有趣。

  4. 您几乎可以想象使用著名 lua-nginx-module 。一些有用的链接(同样,从Google搜索结果的第一页开始)是


  5. 尽管这仅与nginx plus有关,但要使答案完成,我不得不提及 ngx_http_auth_jwt_module 以及F5的一些正式文章:


  1. The old good Basic authentication still exists, among with the ngx_http_auth_basic_module. Unfortunately the only algorithm that is implemented by nginx itself is the old and weak apache MD5, however using glibc based host systems you have some other options. You can find out more details here.

  2. You can authenticate your users using client-side certificates. There are many articles all over the internet; here is the Client-Side Certificate Authentication with Nginx from the first search results page by google.

  3. You can use the js_content directive from njs module as the auth location content handler (instead of proxying auth request to some backend app). Or you can do both things, you may find the Validating OAuth 2.0 Access Tokens with NGINX and NGINX Plus article to be very interesting.

  4. You can implement almost every authentication mechanism you can ever imagine using the famous lua-nginx-module. Some useful links (again, from the very first page of google search results) are

  5. Although this one related only to Nginx Plus, to made the answer complete I had to mention ngx_http_auth_jwt_module and a few official articles from F5:

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文