gpt4 book ai didi

apache - Apache 是否允许根据子请求的结果授权 HTTP 请求?

转载 作者:行者123 更新时间:2023-12-01 05:30:41 26 4
gpt4 key购买 nike

我正在寻找 nginx http auth request module 的等价物但对于 Apache 。

对于每个传入的 HTTP 请求,模块都会向身份验证/授权后端发送一个子请求。 auth 请求携带原始请求的路径和所有 header 。根据身份验证请求的结果,允许原始请求(HTTP 代码 200)、拒绝(HTTP 代码 403)或请求登录(HTTP 代码 401)。这种通用机制允许构建真正灵活的身份验证和授权方案。

在 Apache 中是否有可能发生这样的事情(可能在某些第三方模块的帮助下)?

最佳答案

这个模块就是这样做的... http://search.cpan.org/~chansen/Authen-Simple-HTTP-0.2/lib/Authen/Simple/HTTP.pm

# 或作为 mod_perl Authen 处理程序

PerlModule Authen::Simple::Apache
PerlModule Authen::Simple::HTTP

PerlSetVar AuthenSimpleHTTP_url "http://www.host.com/protected"

<Location /protected>
PerlAuthenHandler Authen::Simple::HTTP
AuthType Basic
AuthName "Protected Area"
Require valid-user
</Location>

关于apache - Apache 是否允许根据子请求的结果授权 HTTP 请求?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11352643/

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