使用nginx代理传递remote_user
问题描述:
我有一个防火墙,它是SSL终结符并设置remote_user标头。这个头文件应该被传递给应用程序,但是我们有一个坐在中间的nginx代理。使用nginx代理传递remote_user
浏览器通过SSL - >防火墙代理 - > Nginx的代理 - >应用
我不能为我的生活弄清楚如何将REMOTE_USER头传递到应用程序从防火墙。 Nginx似乎吞噬了它。 $ remote_user没有它(这是有道理的)。 $ http_remote_user没有它(这没有意义)。我试图在$ proxy_add_ *中找到它,但不能。
SSL终结符不是nginx时,如何通过remote_user标头传递代理?
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
OLD ANSWER
您正在寻找proxy_pass_header
proxy_set_header REMOTE_USER鲍勃;工作很棒虽然...为鲍勃。 – Thomas
您确定您的防火墙代理已成功设置'remote_user'标头吗? nginx是否会收到它? – sharif9876
设置了underscores_in_headers;因为下面陈述的谣言是缺失的环节。 – Thomas