【问题标题】:Apache2 proxy tomcat load balancing URL sub-path not working: No protocol handler was valid for the URLApache2 代理 tomcat 负载平衡 URL 子路径不起作用:没有协议处理程序对 URL 有效
【发布时间】:2022-10-13 01:41:56
【问题描述】:

Apache2 tomcat 负载平衡 URL 子路径不起作用。没有对 URL 有效的协议处理程序。

 <VirtualHost *:443>    
        ServerName www.myexample.com      
        ProxyPreserveHost On

        SSLProxyEngine On
        SSLProxyCheckPeerCN on
        SSLProxyCheckPeerExpire on

        <Proxy "balancer://mycluster">
                BalancerMember "https://localhost:8443" route=node1
        </Proxy>

        ProxyPass        "/" "balancer://mycluster" stickysession=JSESSIONID|jsessionid scolonpathdelim=On
        ProxyPassReverse "/" "balancer://mycluster"

        ...
</VirtualHost>

根 URL

 https://www.myexample.com

作品。但是无法加载图片、js/css等资源。例如。,

 https://www.myexample.com/images/logo.jpg
 https://www.myexample.com/css/main.css

阿帕奇错误日志:

AH01144: No protocol handler was valid for the URL /images/logo.jpg (scheme 'balancer'). If you are using a DSO version of mod_proxy, make sure the proxy submodules are included in the configuration using LoadModule., referer: https://www.myexample.com:443/

已加载 Apache 模块

$ sudo apachectl -M
Loaded Modules:
 core_module (static)
 so_module (static)
 watchdog_module (static)
 http_module (static)
 log_config_module (static)
 logio_module (static)
 version_module (static)
 unixd_module (static)
 access_compat_module (shared)
 alias_module (shared)
 auth_basic_module (shared)
 authn_core_module (shared)
 authn_file_module (shared)
 authz_core_module (shared)
 authz_host_module (shared)
 authz_user_module (shared)
 autoindex_module (shared)
 deflate_module (shared)
 dir_module (shared)
 env_module (shared)
 filter_module (shared)
 lbmethod_byrequests_module (shared)
 mime_module (shared)
 mpm_event_module (shared)
 negotiation_module (shared)
 proxy_module (shared)
 proxy_balancer_module (shared)
 proxy_http_module (shared)
 reqtimeout_module (shared)
 setenvif_module (shared)
 slotmem_shm_module (shared)
 socache_shmcb_module (shared)
 ssl_module (shared)
 status_module (shared)

还需要任何其他 apache 模块吗?

Server version: Apache/2.4.41 (Ubuntu)
Server built:   2022-06-14T13:30:55

【问题讨论】:

    标签: apache tomcat apache2 load-balancing reverse-proxy


    【解决方案1】:

    对于 HTTPS,您需要 proxy_connect 模块

    【讨论】:

      猜你喜欢
      • 2018-06-29
      • 2021-05-26
      • 2014-07-18
      • 2014-12-01
      • 1970-01-01
      • 2016-11-26
      • 2011-01-15
      • 2013-04-28
      • 2017-10-09
      相关资源
      最近更新 更多