mod_proxy+mod_rewrite

mod_proxy is an Apache module used to add proxy functionality to the web server.

RewriteRule      ^/foo(.*) proxy:http://localhost:8180/foo$1 [L]
ProxyPassReverse /foo      http://localhost:8180/foo