How to proxy context to different backend context in apache
Your source location is /myapp
, while your ProxyPassReverse
is for /myapp/
; context of the proxied location doesn't match, so the ProxyPassReverse
doesn't apply.
Why the mod_rewrite proxy? This should accomplish the same, and have no trailing slash consistency issues:
ProxyPass /myapp http://backend-server:8000
ProxyPassReverse /myapp http://backend-server:8000
I had same problem and fix it as follow:
For some reason both context path must be the same so, I mod my application context path to be the equal (note extra "/" on passResever)
ProxyPass /jira http://192.168.1.30:8080/jira
ProxyPassReverse /jira/ http://192.168.1.30:8080/jira