gpt4 book ai didi

nginx - 使用 nginx 代理传递 remote_user

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

我有一个防火墙,它是 SSL 终止符并设置了 remote_user header 。这个头应该传递给应用程序,但是我们有一个位于中间的 nginx 代理。

SSL 浏览器 -> 防火墙代理 -> Nginx 代理 -> 应用

我一生都无法弄清楚如何将 remote_user header 从防火墙传递到应用程序。 Nginx 似乎吞了它。 $remote_user 没有它(这是有道理的)。 $http_remote_user 没有它(这没有意义)。我试图在 $proxy_add_* 中找到它,但找不到。

当 SSL 终止符不是 nginx 时,如何代理传递 remote_user header ?

EDIT1:我尝试过的其他事情:

proxy_pass_request_headers on;
proxy_pass_header remote_user;
proxy_set_header other_user $http_remote_user;

proxy_pass http://scooterlabs.com/echo;

最佳答案

您需要使用 proxy_pass_request_headers on 的组合和 underscores_in_headers on因为您的标题包含下划线。
underscores_in_headers需要放在你的 http 块中。

见:http://nginx.org/en/docs/http/ngx_http_core_module.html#underscores_in_headers

旧答案

您正在寻找 proxy_pass_header
见:Module ngx_http_proxy_module

关于nginx - 使用 nginx 代理传递 remote_user,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45423424/

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