Determining correct context path behind AJP proxy

69 Views Asked by At

I've got a WildFly/JBoss with more than one web application. Each has its own context-root.

For example:

  • webapp1.war is mapped with <context-root>/webapp1\</context-root>
  • webapp2.war is mapped with <context-root>/webapp2\</context-root>
  • ...

In an upstream Apache server we have an AJP configuration for each of the web applications:

<VirtualHost webapp1.example.com:80>
ProxyPass / ajp://123.123.123.123:8009/webapp1/
</VirtualHost>

<VirtualHost webapp2.example.com:80>
ProxyPass / ajp://123.123.123.123:8009/webapp2/
</VirtualHost>

The problem is, that webapp1 and webapp2 still think, they are visible under /webapp.../ (as HttpServletRequest.getContextPath() still returns that path) and all generated absolute URLs (for example to CSS and JS files from the application) do include the context path.

How can I tell WildFly/JBoss to provide the context path without the (invisible) prefix when it is accessed by the AJP connection?

0

There are 0 best solutions below