Apache + Tomcat: Using mod_proxy instead of AJP

前端 未结 3 1786
情书的邮戳
情书的邮戳 2020-12-02 07:34

Is there any way I connect Apache to Tomcat using an HTTP proxy such that Tomcat gets the correct incoming host name rather than localhost? I\'m using this directive in apac

3条回答
  •  [愿得一人]
    2020-12-02 08:14

    You can still use AJP, and you should since it's faster than HTTP. Just make sure to enable it in http.conf:

    LoadModule proxy_module modules/mod_proxy.so
    LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
    

    In that case, this configuration works for me:

    
      ServerName public.server.name
    
      ProxyRequests Off
      ProxyPreserveHost On
    
      
        Order deny,allow
        Allow from all
      
    
      ProxyPass / ajp://localhost:8080/
    # ProxyPassReverse might not be needed,
    # it's only for redirecting from inside.
    #  ProxyPassReverse / ajp://localhost:8080/
    
    

提交回复
热议问题