0

I am running Apache in front of a Tomcat instance. Apache proxies every request that comes through and passes it on to Tomcat. The current configuration is such that Apache puts a ProxyPass on the root (/). There are however, new requirements, which specify that a call to the root of the domain should return a static splash page, and any other call should be proxied.

This means:

www.domain.com -> static page
www.domain.com/username - proxy to Tomcat

Making multiple ProxPass directives is not a good idea, because there are a lot of paths that must be supported by the Tomcat instance, and many of them change.

user802232
  • 103
  • 2

2 Answers2

4

Redirect any requests for plain www.domain.com to www.domain.com/index.html and then add an proxy exclude before forwarding everything else to Tomcat:

RewriteRule  ^/$                 /index.html
ProxyPass /index.html !
ProxyPass / http://localhost:8080/
ProxyPassReverse / http://localhost:8080/
HBruijn
  • 77,029
  • 24
  • 135
  • 201
1

Another possible solution:

<LocationMatch "/.+">
     # ProxyPass directives
</LocationMatch>
Shane Madden
  • 114,520
  • 13
  • 181
  • 251
stoned
  • 808
  • 5
  • 10