在两个不同的 Apache 代理网关上使用 AmAgent 配置

在两个不同的 Apache 代理网关上使用 AmAgent 配置

为了对我们的应用程序的用户进行身份验证,我有一个设置,可以用下图表示:

图片来自 Oracle OpenSSO 文档

我有一台正在OpenAM运行的服务器(图中的 OpenSSO Enterprise),有几台客户端服务器,并使用一台Apache2( HTTPD) 服务器作为具有两个代理配置的反向代理。我使用以下虚拟主机配置实现了身份验证和重定向的功能流程:

<VirtualHost *:443>
    AmAgent On
    AmAgentConf /opt/web_agents/apache24_agent/bin/../instances/agent_1/config/agent.conf

    ProxyPreserveHost On
    ProxyPass /application1 https://server1.com:10443/application1
    ProxyPassReverse /application1 https://server1.com:10443/application1
</VirtualHost>

我连接到,重定向进行 OpenAM 身份验证,并在登录后https://reverseproxy.com/application1重定向到我的登录页面。我还有一个辅助配置( ),它根据 OpenAM 中配置的策略配置文件执行正确的授权。server1.comagent_2

当我想要在两个不同的实例上配置两个不同的 OpenAM 配置时,我遇到了问题ProxyPass/ProxyPassReverse。上面的代码片段AmAgentConf在监听端口 443 的虚拟主机内使用了 on 。但我希望两个应用程序(都可以通过同一个反向代理 URL 访问)使用正确的代理配置。理想情况下,我想要以下内容:

<VirtualHost *:443>
    ProxyPreserveHost On

    ProxyPass /application1 https://server1.com:10443/application1
    ProxyPassReverse /application1 https://server1.com:10443/application1

    ProxyPass /application2 https://server2.com:443/application2
    ProxyPassReverse /application2 https://server2.com:443/application2

    <Proxy "https://server1.com:10443/*">
        AmAgent On
        AmAgentConf /opt/web_agents/apache24_agent/bin/../instances/agent_1/config/agent.conf
    </Proxy>

    <Proxy "https://server2.com:443/*">
        AmAgent On
        AmAgentConf /opt/web_agents/apache24_agent/bin/../instances/agent_2/config/agent.conf
    </Proxy>
</VirtualHost>

但指令内AmAgent不允许。AmAgentConf<Proxy/>

centos httpd[1238]: AH00526: Syntax error on line 28 of /etc/httpd/conf.d/default-site.conf:
centos httpd[1238]: AmAgent not allowed here

我已阅读有关 OpenAM 文档在虚拟主机上配置 OpenAM,但我没有配置两个单独的DocumentRoot。应用程序不在 Apache 本身上,它只是转发。

我可能能够监听两个单独的端口(例如 443 和 444)并根据端口配置代理。但这太荒谬了。这似乎是一个常见问题,但我的配置就是不配合。

那么本质上,如何配置两个(或更多)代理应用程序以使用替代代理配置?

相关内容