How to use a different path name in ProxyPass than the Tomcat context name

45,801

Solution 1

I believe you need both

ProxyPass /path/ http://localhost:8080/contextname/
ProxyPassReverse /path/ http://localhost:8080/contextname/

Any reason not to use mod_jk?

Solution 2

Add a slash to both values:

ProxyPass /path/ http://localhost:8080/contextname/

Solution 3

Your problem are probably self-referential URLs that the application produces. There isn't much you can do about it except for

  1. changing the app or
  2. rewrite everything that it spits out.

Option 2 can be very fragile. See the tomcat docs for more info.

Share:
45,801
Diptendu Dutta
Author by

Diptendu Dutta

Updated on September 09, 2020

Comments

  • Diptendu Dutta
    Diptendu Dutta over 3 years

    I am using Tomcat 5.5.9 and Apache 2.x

    We are trying to use a path name in ProxyPass that is different than the Tomcat context name.

    ProxyPass /path http://localhost:8080/contextname
    

    However, this does not work. When these two are the same then everything works fine.

    Most examples I see on the net also have the path equal to the Tomcat context name.

    I am using "context.xml" within the Tomcat context and do NOT have "server.xml" entries. Also, I am using plain httd.conf and NOT using any VirtualHost entries.