gpt4 book ai didi

Apache ProxyPass 删除 Authorization header

转载 作者:行者123 更新时间:2023-12-01 15:02:25 25 4
gpt4 key购买 nike

我在一些后端服务器前面设置了一个 Apache 服务器作为反向代理。其中一台后端服务器需要基本身份验证,但 Apache 似乎以某种方式从请求中删除了 Authorization header 。

我是否必须配置一些特殊的东西才能让 Apache 将 Authorization header 传递给后端服务器?

我的 Apache 配置非常基本。我只添加了一些代理指令,例如:

ProxyRequests Off
ProxyPass /backend-server https://backend.server

SSLProxyEngine on

最佳答案

您必须设置 proxy-chain-auth环境变量:

If the proxy requires authentication, it will read and consume the proxy authentication credentials sent by the client. With proxy-chain-auth it will also forward the credentials to the next proxy in the chain. This may be necessary if you have a chain of proxies that share authentication information. Security Warning: Do not set this unless you know you need it, as it forwards sensitive information!



http://httpd.apache.org/docs/2.2/mod/mod_proxy_http.html
<Location />
AuthType basic
SetEnv proxy-chain-auth
</Location>

关于Apache ProxyPass 删除 Authorization header ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38057978/

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