Let Apache connect through a proxy
I have a question to let HTTP Proxy requests via a proxy.
Here is the situation: - I am connected from home to a VPN of my company. - The VPN has a proxy server, which I have configured and it works correctly. I can reach all internal company URL's now.
Now I have the situation that Apache needs to retrieve a URL as well, via that same proxy. And that is where it goes wrong. The request times out. From the browser I can reach that internal URL fine, because the browser is using the proxy for its requests.
So how can I set up Apache to use a proxy?
Please note, I am not asking how to get ProxyPass working, but I am trying to make this work:
<Location /shared_resources_url/>
ProxyPass http://www.internalcompanyserver.com/shared_resources_url/
ProxyPassReverse http://www.internalcompanyserver.com/shared_resources_url/
</Location>
So, Apache needs to reach the internalcompanyserver.com . How do I configure Apache to use the company proxy?
I tried Googling this one of course, but I get a lot of results about ProxyPass, not about actually letting Apache connect through a proxy first.
I hope somebody understands what my question is and can help me out! :)
It looks like the ProxyRemote setting might do what you desire: http://httpd.apache.org/docs/2.2/mod/mod_proxy.html#proxyremote
(apache) in your virtualhost you can declare your web proxy :
ProxyRemote http http://xxxxxxx:8080
ProxyRemote https http://xxxxxxx:8080
ProxyRemote ftp http://xxxxxxx:8080
OR
ProxyRemote * http://xxxxxxx:8080
Otherwise, in /etc/sysconfig/httpd, you can add :
export http_proxy="http://xxxxxxx:8080/"
export https_proxy="http://xxxxxxx:8080/"
(but this applies to all virtualhosts...)