简体   繁体   English

如何使用proxypassreverse将remote_user变量从apache传递给apache

[英]How to pass the remote_user variable from apache to apache using proxypassreverse

I have web application accessed via IBM IHS, this application is Tivoli ldap authenticated. 我有通过IBM IHS访问的Web应用程序,此应用程序是经过Tivoli ldap认证的。 from this application I have to click on link which should be served by another Apache server but I have to pass the username with the request so the other application server will populate data based on the user name passed from IBM IHS server. 从这个应用程序,我必须点击应由另一个Apache服务器提供服务的链接,但我必须传递带有请求的用户名,以便其他应用程序服务器将根据从IBM IHS服务器传递的用户名填充数据。 I'm able to open the other link via proxypassreverse rule inside httpd.conf but I'm not able to pass the remote_user header variable 我可以通过httpd.conf中的proxypassreverse规则打开另一个链接,但是我无法传递remote_user头变量

rules added to httpd.conf 规则添加到httpd.conf

ProxyPass /ebill_testselfcare http://10.243.97.24/ebill_testselfcare
ProxyPassReverse /ebill_testselfcare http://10.243.97.24/ebill_testselfcare
RewriteEngine on
RewriteCond %{IS_SUBREQ} ^false$
RewriteCond %{LA-U:REMOTE_USER} (.+)
RewriteRule .* - [E=PROXY_USER:%{LA-U:REMOTE_USER}]
RequestHeader set REMOTE_USER %{PROXY_USER}e

do NOT use the following, because you will get into trouble with execution phases if the REMOTE_USER is set with a module like mod_authn_ntlm (ntlm with local computer, see https://support.microsoft.com/en-us/kb/896861 ). 请勿使用以下内容,因为如果使用mod_authn_ntlm等模块设置REMOTE_USER,则会遇到执行阶段的问题(ntlm与本地计算机有关,请参阅https://support.microsoft.com/en-us/kb/896861 ) 。

RewriteCond %{LA-U:REMOTE_USER} (.+)
RewriteRule . - [E=RU:%1]
RequestHeader set X-Remote-User %{RU}e

instead use the following methods: 而是使用以下方法:

RequestHeader set X-Remote-User expr=%{REMOTE_USER}

there is also a solution with mod_ssl 还有一个mod_ssl的解决方案

RequestHeader set X-Remote-User %{REMOTE_USER}s

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM