Apache Trailing Slash Problem
I was helping our IT guys out this past weekend configuring a reverse proxy load balancing environment for JBoss/Tomcat behind Apache. I kept running into problems where requests coming from Apache looked like:
GET /foo//bar instead of GET /foo/bar
Unfortunately this was causing NPEs and resource not found errors in a third party servlet filter we are using to combine some our static resources. This is the Apache configuration that seems to have resolved the problem, I just wanted to post it here in case I ran up against it again.
# Placed in Apache conf for the site <Proxy balancer://app_cluster > BalancerMember http://app1/foo BalancerMember http://app2/foo BalancerMember http://app3/foo </Proxy> ProxyPass /foo/ balancer://app_cluster/ stickysession=JSESSIONID ProxyPassReverse /foo/ http://app1/foo/ ProxyPassReverse /foo/ http://app2/foo/ ProxyPassReverse /foo/ http://app3/foo/
The lesson here is attention to detail, especially your final slashes.
Thanks for the useful info. It’s so interesting
The article is ver good. Write please more
The article is usefull for me. I’ll be coming back to your blog.