I want to achieve the following:
My app services user requests like so:
user request www.mysite.com -> Apache reverse proxy -> 192.168.1.1:8080/myApp
My app also makes requests but I want to route through a proxy:
192.168.1.1:8080/myApp -> Apache forward proxy -> www.google.com
Can I set this up on the same Apache server? If not, can I do it with two Apache servers on the same system?
2
Answers
My solution is to set up two virtual hosts in apache with different ports, one acting as a reverse proxy and the other, a forward proxy.
One conf file contains
ProxyRequest on
which makes Apache work as Forward-proxy and put ProxyRemote tolocalhost:high-port
, and another conf file contains VHOST block for each port withProxyRequest off
which make Apache asReverse-proxy
.