0

我有几个 JBoss 和 Tomcat 服务器的环境。它们通过 modcluster 模块连接到 Apache(连接到 Apache IP 地址和端口 8090)。Apache 包含以下配置:

负载均衡器.conf

LoadModule slotmem_module modules/mod_slotmem.so
LoadModule manager_module modules/mod_manager.so
LoadModule proxy_cluster_module modules/mod_proxy_cluster.so
LoadModule advertise_module modules/mod_advertise.so

Listen *:8090
<VirtualHost *:8090>

 <Location /mod_cluster_manager>
    SetHandler mod_cluster-manager
    Order deny,allow
    Deny from 8.8.8.8
    Allow from all
  </Location>

  KeepAliveTimeout 60
  MaxKeepAliveRequests 100
  EnableMCPMReceive
  ManagerBalancerName My_Cluster
  AdvertiseFrequency 5

</VirtualHost>

<VirtualHost *:443>
    SSLEngine on
    SSLCertificateFile /etc/pki/tls/certs/ca.crt
    SSLCertificateKeyFile /etc/pki/tls/private/ca.key

ProxyPass /other_app http://192.168.100.70:8080/other_app
ProxyPassReverse /other_app http://192.168.100.70:8080/other_app

ProxyPass / balancer://My_Cluster

</VirtualHost>  

一切正常,但一个新应用程序不支持连接到 Apache。我需要使用 ProxyPass。当我将 ProxyPass 插入到 443 虚拟主机时,所有平衡的上下文都停止工作。当我插入: ProxyPass / balancer://My_Cluster /other_app 上下文停止工作。

你能告诉我如何配置 ProxyPass 处理的上下文 /other_app 和 modcluster 平衡器的所有其他上下文吗?

4

2 回答 2

0

尝试使用以下顶级指令(在 LoadModule 的下方添加)

#This is needed to prevent mod_cluster creating balancer for all VH's
CreateBalancers 1
于 2015-09-10T14:33:51.173 回答
0

设法通过以下方式做到这一点:

ProxyPass /other_app http://192.168.100.70:8080/other_app
ProxyPassReverse /other_app http://192.168.100.70:8080/other_app
ProxyPass /other_app !

ProxyPass / balancer://My_Cluster

灵感来自https://serverfault.com/questions/363788/serve-all-requests-via-proxy-except-a-specific-one

于 2021-06-11T22:55:24.290 回答