[英]Using mod_proxy_cluster and mod_proxy in one VirtualHost of Apache (httpd) configuration
我有幾個 JBoss 和 Tomcat 服務器的環境。 它們通過 modcluster 模塊連接到 Apache(連接到 Apache IP 地址和端口 8090)。 Apache 包含配置:
負載均衡器配置文件
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 和 modcluster 平衡器配置所有其他上下文的上下文 /other_app 處理嗎?
嘗試使用以下頂級指令(在 LoadModule 的正下方添加)
#This is needed to prevent mod_cluster creating balancer for all VH's
CreateBalancers 1
設法做到了以下幾點:
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
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.