Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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! :)

share|improve this question
add comment

2 Answers

up vote 2 down vote accepted

It looks like the ProxyRemote setting might do what you desire: http://httpd.apache.org/docs/2.2/mod/mod_proxy.html#proxyremote

share|improve this answer
    
That's it! Thanks for the answer! :) I configured it in this way: ProxyRemote internalcompanyserver.com/shared_resources_url address_of_proxy:port . And it actually makes sense. I have added it in front of the ProxyPass (outside the Location element) and it works like a charm. –  Sander May 25 '12 at 10:14
add comment

The thing is you are expecting wrong. If you want to retrieve a url then it is done via code that runs inside apache. AFAIK, apache is for serving content not retrieving content. Retrieving content is done by either code (like php, java , etc) or tools like wget or curl. Both wget and curl very well support connecting through proxy.

share|improve this answer
    
I think Apache is really the one who is not routing the request correctly, in fact.. if I want to Proxy a URL with a ProxyPass, it also needs to know of the Connection Proxy, otherwise Apache can't serve the content that needs to be requested via the proxy. So in this case, I think Apache is the application that retrieves the content :) –  Sander May 25 '12 at 10:08
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.