当“位置”设置为/ *时,“远程用户”标题不会出现在自定义标题中

问题描述

设置

Apache用于代理来自客户端(SPA)应用程序的传递请求。用户使用Chrome通过VDI(虚拟桌面基础结构)访问应用程序

应用程序是使用React / NodeJS堆栈编写的

在访问应用程序之前,先使用MS Active Directory对用户进行身份验证。我们使用Apache的mod_auth_kerb模块来协商Kerberos

我们将Location指令用于下面提到的配置

问题:

当“位置”设置为/ *时,未设置自定义标头“ X-Remote_User”,并且我们将收到401消息,并且无法访问该应用程序。

但是,我们可以确认变量中存在远程用户(%REMOTE_USER)值,因为即使位置为/或/ *,我们也可以将其记录在日志文件中。

在配置中,我们可能会出错?在这里感谢您的帮助。预先谢谢你。

配置

LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule headers_module modules/mod_headers.so
LoadModule auth_kerb_module modules/mod_auth_kerb.so
LoadModule unique_id_module modules/mod_unique_id.so
LoadModule ssl_module modules/mod_ssl.so

<VirtualHost *:8080>
ServerName ip-1-2-3-4.internal-aws.ad
        ProxyRequests Off
        <Proxy \*>
                Order deny,allow
                Deny from all
        </Proxy>
                <Location /*>
                        AuthType Kerberos
                        AuthName "Kerberos Login"
                        KrbAuthRealms INTERNAL-AWS.AD
                        KrbServiceName host/[email protected]
                        Krb5Keytab /etc/httpd/krb5.keytab
                        KrbMethodNegotiate on
                        KrbAuthoritative on
                        KrbMethodK5Passwd off
                        KrbLocalUserMapping on
                        KrbSaveCredentials on
                        Require valid-user
                        RequestHeader set X-Remote_User %{REMOTE_USER}s
                </Location>
        <Proxy balancer://mycluster_ip-10-55-52-6.internal-aws.ad>
                BalancerMember http://ip-5-6-7-8.internal-aws.ad:3000
                BalancerMember http://ip-7-6-5-4.internal-aws.ad:3000

                Order allow,deny
                Allow from all

                ProxySet lbmethod=byrequests
    </Proxy>

                SSLProxyEngine on
                SSLEngine on
                SSLProtocol TLSv1.2
                SSLHonorCipherOrder On
                SSLCipherSuite ALL:!EXP:!NULL:!ADH:!LOW:!SSLv2:!MD5:!RC4
                SSLCertificateFile "/opt/Infra/security/x509/server.pem"
                SSLCertificateKeyFile "/opt/Infra/security/x509/server-nopass.key"
                RewriteEngine On
    ProxyPass /balancer-manager !
        ProxyPass / balancer://mycluster_ip-10-55-52-6.internal-aws.ad:3000/
        ProxyPassReverse / balancer://mycluster_ip-10-55-52-6.internal-aws.ad:3000/
</VirtualHost>

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)