AJP proxy that maps internal servlet name to a different external name

Posted by sakra on Stack Overflow See other posts from Stack Overflow or by sakra
Published on 2010-02-10T12:10:02Z Indexed on 2010/05/27 22:01 UTC
Read the original article Hit count: 451

Filed under:
|
|

Using apache2 I want to set up an AJP proxy for a Tomcat server that maps an internal servlet URL to a completely different URL externally. Currently I am using the following configurations:

Apache2 configuration:

<IfModule mod_proxy.c>
    ProxyPreserveHost on
    ProxyPass /external_name ajp://192.168.1.30:8009/servlet_name
    ProxyPassReverse /external_name ajp://192.168.1.30:8009/servlet_name
</IfModule>

Note that external_name and servlet_name are different.

Tomcat 6 configuration:

<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />

This however does not work. Apache seems to forward http requests to Tomcat. However the URLs and redirects returned by Tomcat are still using the original servlet_name and Apache does not map them to external_name.

Is this possible at all with AJP? If not can it be done using a plain http proxy instead?

© Stack Overflow or respective owner

Related posts about apache

Related posts about tomcat